1

Is it possible if I use multiple translate files in locale directory in my themes instead of only one file translate.csv ?

Manage a huge file with 100k+ lines is a nightmare to me.

2

1 Answer 1

2

Not in the theme but if that's an option for you (i.e. you do not need to tie the translation to specific themes), you could define your translations in a module, where multiple files are allowed. This is how your module's config.xml could look like:

...
<frontend>
    <translate>
        <modules>
            <MyStore_Translate>
                <files>
                    <catalog>MyStore_Catalog.csv</catalog>
                    <checkout>MyStore_Checkout.csv</checkout>
                    <sales>MyStore_Sales.csv</sales>
                    <other>MyStore_Other.csv</other>
                </files>
            </MyStore_Translate>
        </modules>
    </translate>
</frontend>

The csv files go into app/locale/[language code]/

This answer perfects this approach. With the code above, the translations would be tied to your custom module and cannot be used to override core translations. But you can also add the files to the corresponding core modules instead:

...
<frontend>
    <translate>
        <modules>
            <Mage_Catalog>
                <files>
                    <custom>MyStore_Catalog.csv</custom>
                </files>
            </Mage_Catalog>
            <Mage_Checkout>
                <files>
                    <custom>MyStore_Checkout.csv</custom>
                </files>
            </Mage_Checkout>
            <Mage_Sales>
                <files>
                    <custom>MyStore_Sales.csv</custom>
                </files>
            </Mage_Sales>
            <MyStore_Translate>
                <files>
                    <other>MyStore_Other.csv</other>
                </files>
            </MyStore_Translate>
        </modules>
    </translate>
</frontend>

This way, when the config XML files are merged, the new translation files will be associated to the core modules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.