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.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityIs 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.
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.