Tue. Jul 2nd, 2024

1. Magento. How to manage CSV files translations

2 min read

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:

magento_how_to_manage_csv_translations1

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:

  1. 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"
  2. 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"
  3. 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.

  4. 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)"
  5. 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).
  6. If you need to have double quotes in your string, they need to be escaped by using two double quotes:
     "Warning!","Attention!"
  7. 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"
  8. Click Save changes button to confirm the changes:magento_how_to_manage_csv_translations2
  9. 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.

July 2024
M T W T F S S
« Jun    
1234567
891011121314
15161718192021
22232425262728
293031