Thursday, February 14, 2013

Steps to be followed to translate a Drupal site to Multi Language

Step 1: Enable the default modules “Locale” and “Content translation” from Drupal admin section.

Step 2: Go to Administer -> Site configuration -> Language. Inside that click “Add Language” Tab, there u will be having a drop down with all available languages in the world, select the desired language from the drop down (as per ur Requirement) like Spanish or French and click “Add Language”.

Step 3: In list tab the language you have just added is listed, in that there is a default Radio button, select default button for the desired language which you are looking for.

Step 4: Create “.po” extension file for the desired language, the file name should be as follows:

Language code.po”

For eg.

The Code for English Language is en, so your “.po” should be “en.po”

The Code for Chinese (Simplified) Language is zh-hans, so your “.po” should be “zh-hans.po”

Step 5: Inside this “.po” file, your translated strings will be entered as follows:

#:/sites/all/modules/exp_sp_base/exp_sp_widgets/js/exp_sp_hradmin/exp_sp_hradmin.module

msgid "Geo Hierarchy"

msgstr "地理层次"

We need to follow the same Standard for any desired language.

From the above Example:

#:/sites/all/modules/exp_sp_base/exp_sp_widgets/js/exp_sp_hradmin/exp_sp_hradmin.module

The link given above is just for our identification, under which path we are going to translate the string.

msgid “Geo Hierarchy”

is the string which you are going to translate

msgstr "地理层次"

is the string converted from English to Chinese (Simplified) Language.

Step 6: Conversion of English to Chinese or any other Desired language

http://translate.google.com/

Using the above link we can convert any text from any language to any other language

In that link there will be two drop downs, from there we can select our corresponding language.

Step 7: Importing a .PO file into our site

Go to Administer -> Site building -> Translate Interface.

Click Import Tab in that link, now browse ur .po file and import. After successful importing of file, check ur corresponding site for changes, ur site will be changed from English to the desired language you have chosen.





No comments: