The following tutorial is going to show how to manage CSV translations in Magento templates.
In order to do that, you just need to create translate.csv in app/design/frontend/default/themexxx/locale/languagecode_COUNTRYCODE and put your translated strings inside this translate.csv file. Some templates may already contain the locales for some languages. You can edit the file via FTP manager (TotalCommaner, FileZilla, etc.) or Hosting Control panel File manager:
NOTE: We recommend disabling Magento cache or clearing it after all configuration changes. Please check the following tutorial for the detailed guidance Magento. How to clear cache .
To perform CSV translations, you need to note the following:
All strings should start and end with double quotes and should be separated with comma (,), not a semicolon or any other sign. For instance:
"Default line","Translated line"
You can alternate the default theme strings with the help of app/design/frontend/default/themexxx/locale/en_US/translate.csv file. For example:
"My Cart","My Basket"
All the lines are case-sensitive and the first message must be copied exactly as it appears in the default en_US version. For example, if in en_US locale the string looks like that:
"%s Item(s)","%s Item(s)"
“%s Items”, “%s item(s)”, etc. wouldn’t work.
Some strings can contain %1$s %s %d etc., and if you want to have the correct strings in your translations, these entries should be also kept in the translated string.
"%s Item(s)","%s Product(s)"
Your text editor should be able to save an edit CSV file in UTF-8 encoding (), especially when you translate using different alphabets. If you have your translations in Excel, you need to convert your file to UTF-8 (find more info on how to convert Excel to CSV with UTF-8 encoding).
If you need to have double quotes in your string, they need to be escaped by using two double quotes:
There are some strings that can be presented in a few extensions simultaneously. For example, in “Add To Cart” strings can be found in both Mage_Catalog.csv and Mage_Checkout.csv. To solve this issue with translate.csv, put your extension name as a prefix and you will be able to translate them separately.
"Mage_Catalog::Add to Cart","Add to Basket"
"Mage_Checkout::Add to Cart","Add to my shopping cart"
Click Save changes button to confirm the changes:
Go back to your website and refresh the page to see changes.
That is the end of the tutorial. Now you know how to manage CSV translations in Magento templates.
Feel free to check the detailed video tutorial below: