X hide

How to Translate Magento Extension Using Theme Files Translation

From Plumrocket Documentation

You are viewing:  Trobleshooting-plumrocket-32.png  Troubleshooting


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.

Attention green.png Important Information:

Make sure to disable 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:

app/design/frontend/<theme>/default/locale/languagecode_COUNTRYCODE

This is an example of the locale for German translation:

app/design/frontend/<theme>/default/locale/de_De


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.

"String",""Translated word""

You can also use html coding to alter your text. Check an example:

"Warning!","<strong style=""color:red"">Attention!</strong>"


6. While performing translation in this file - any word or phrase will be translated for the entire theme. If you need to translate 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.
.

Navigation