Managing Magento csv Translation Files

Try this.

To sum, specify an additional translation file under the core module's translation XPath and place your overriding CSV pairs in there.

<frontend>
    <translate>
        <modules>
            <Mage_Sales>
                <files>
                    <mr_storms_wicked_translations>Mage_Sales_Custom.csv</mr_storms_wicked_translations>
                </files>
            </Mage_Sales>
        </modules>
    </translate>
</frontend>

Beside the translate.csv and the non-portable inline translate there is an other way. I do it like this.

Each module supports more than one translation file.

If you add this in config.xml:

    <translate>
        <modules>
            <[Namespace]_[Module]>
                <files>
                    <default>[Namespace]_[Module].csv</default>
                    <alternative>[Namespace]_[Module]_version2.csv</alternative>
                </files>
            </[Namespace]_[Module]>
        </modules>
    </translate>

both files [Namespace]_[Module].csv and [Namespace]_[Module]_version2.csv will be loaded for translation.

and they will be processed in the order in which they are declared.

So if you need for example to add/modify something in the Mage_Sales.csv don't edit the file just create a module that adds an other file to the translation files list.

Something like this:
app/code/local/Easylife/Sales/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Easylife_Sales>
            <version>0.0.1</version>
        </Easylife_Sales>
    </modules>
    <frontend>
        <translate>
            <modules>
                <Mage_Sales>
                    <files>
                        <alternative>Easylife_Sales.csv</alternative>
                    </files>
                </Mage_Sales>
            </modules>
        </translate>
    </frontend>
    <adminhtml>
        <translate>
            <modules>
                <Mage_Sales>
                    <files>
                        <alternative>Easylife_Sales.csv</alternative>
                    </files>
                </Mage_Sales>
            </modules>
        </translate>
    </adminhtml>
</config>

and make sure you make the module depend on Mage_Sales.
You can also create a "one size fits all" module for managing the translation. Just add an alternative translation file for any module you need and make sure this new module depends on all of them.


CSV files located in app/locale should be regarded as core files and not modified. I find that the best way to add custom translation is to put them into app/design/frontend/{package}/{theme}/locale/{locale}/translate.csv

Please note that you can use module names in translate.csv files as well using "Mage_Adminhtml::Sales","Sales" instead of "Sales","Sales". This also allows you to use translations that are custom tailored to specific themes.