Wednesday , December 19 2018
Home >> All tutorial >> Editing Magento Translate.csv File

Editing Magento Translate.csv File

There is a way to edit translation CSVs using one file – translate.csv. In order to do that, you just need to set locale via Magento admin area, then create translate.csv inapp/design/frontend/<package>/<theme>/locale/languagecode_COUNTRYCODE and put your translated strings inside this translate.csv file.

Here are some tips and tricks:

  •  All strings should start and end with double quotes and should be separated with comma (,), not a semicolon or any other sign
  1. “Default line”,“Translated line”
  • It can be very handy to alternate the default theme strings with the help ofapp/design/frontend/<package>/<theme>/locale/en_US/translate.csv file

For example:

  1. “My Cart”,“My Basket”
  3. “My Account”,“Your Account”
  •  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

  1. “%s Item(s)”,“%s Item(s)”

But in your translate.csv you would try

  1. “%s Items”,“%s Product(s)”

It simply wouldn’t work, so be careful with that.

  •   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
  1. “%s Item(s)”,“%s Product(s)”
  • Your text editor should be able to save an edited 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 StackOverflow).
  •  If you need to have double quotes in your string they need to be escaped by using two double quotes
  1. “String”,” “” – this is how double quotation mark looks like”
  3. “Warning!”,“<strong style=””color:red””>Attention!</strong>”
  • 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. What if you would like to translate/change them differently? Normal way would be to edit .phtml files manually, but with translate.csv you can solve this issue more elegantly – just put your extension name as a prefix and you will be able to translate them separately.
  1. “Mage_Catalog::Add to Cart”,“Add to Basket”
  3. “Mage_Checkout::Add to Cart”,“Add to my shopping cart”
  • Last but not least – remember to refresh all caches after any changes of your translate.csv file!

Here is the library of Magento Download for FREE (all versions)

Your Magento website needs a powerful Magento ERP for stock control.


magento erp

About Champ

Leave a Reply

Your email address will not be published. Required fields are marked *

Heap | Mobile and Web Analytics