Mapping Multiple Translations & Labels

Posted on 24 Jan 2016 MagentoMarketing

An often overlooked feature by developers & business / marketing alike is the power of using the built in translation of the mail labels in Magento. Often front-end developers will simple change all the text in each template.

At some stage when you decide to scale to an international language set, time can be lost refactoring the existing templates to play nicely with your multi-lingual sites. So to set up your store for success, let’s look at some of the best practices in changing the key labels in the main areas on your site through the translation file(s).

Firstly set your translation, the default is ‘English (United States)’ so we’ll assume that you are using this set in the provided examples and {package} is your package and {theme} is your chosen theme.

The default is to look in the folder:

app/locale/en_US/*

If you would like to change the default you will need to make a change in the backend administration area:
System > Configuration > General > Locale Options.

Configuration _ System _ Magento Admin_ - http___local-newshop.acer.edu.au_in

You can edit these files directly if you like but it’s best practise and easier to see what you have changed over time and migrate changes from new versions of Magento incrementally by leaving these core files untouched as they are and override them individually as required in:

app/design/frontend/{package}/{theme]/locale/en_US/translate.csv.

So where you see “Text here”,”Translation here”. The translation is where you can change your the text without touching any templates. For example “Login”, “Your Login” would display “Your Login” on the login page.

In regards to developing your template when ever you see ($this->__) such as below it will map to an appropriate translation.csv file.

__('Text here'); ?>

If you fancy to have an english, french and german version of your site, you can copy the file(s) to a a new file (such as below) and a translating can simple edit the CSV file to your liking.

app/design/frontend/{package}/{theme]/locale/en_US/translate.csv.
app/design/frontend/{package}/{theme]/locale/de_DE/translate.csv.
app/design/frontend/{package}/{theme]/locale/fr_FR/translate.csv.

Leave a Reply

Your email address will not be published.

*