In this article, you will learn how to perform Magento theme files translation. Usually, the translations are being stored in the .csv files on your server. However, if for some reason there’s no CSV translation file translated for your language – you will need to create the .csv file from scratch. To create the CSV translation file – please follow the steps below.
Make sure to disable the Magento cache before proceeding with .csv file translation.
1. First you need to set a locale in your Magento admin panel and create a translate.csv file in it. Please, check the directory:
This is an example of the file for German translation:
2. While translating, make sure all the strings in your .csv file start and end with double quotes, and are separated with comma [,], not semi-colon [;] or any other mark.
"Add to Cart", "Translated Text"
3. You can change the default theme strings according to the requirements of your website.
"My Cart","My Basket" "My Account","Your Account"
4. All the lines are case-sensitive, you should copy the phrase exactly as it is in the “en_US” version.
In the source “en_US” version the text looks like this:
"%s Item(s)","%s Item(s)"
The translated text should look like this:
"%s Items","%s Product(s)"
5. Make sure your text editor saves .csv file in UTF-8 encoding, as it supports different alphabets. If you edit the file using Excel, convert it into UTF-8 encoding once you finish editing.
6. If you need to set off a word or phrase by quotation marks, put two double quotation marks for such string.
You can also use HTML coding to alter your text. Check an example:
7. While performing translation in this file – any word or phrase will be translated for the entire theme. If you need to translate the same element in different ways for different pages, you can use this example:
"Mage_Catalog:Add to Cart","Add to Basket" "Mage_Checkout:Add to Cart","Add to my shopping cart"
To read more information about Magento translations, please click here.