Enabling and Importing Translations

After enabling the Locale module from the admin/modules window, browse to administer > localization > add language (admin/locale/language/add), and choose the language you would like to add from the Language Name list. Then click the Add Language button immediately below the list. You will be taken to the list of activated languages (admin/locale), where you can confirm your selection. If the language you are looking for does not appear in the Language Name list, or if you wish to add a country-specific variation of a language such as en-US, use the Custom Language fields on the admin/locale/language/add page.

You can import and export Drupal translations from Portable Object (PO) files. A PO file contains many entries, each describing the relation between an original untranslated text and its corresponding translated version. (See http://www.gnu.org/software/gettext/manual/ html_node/gettext_9.html for a good description of PO files.) The files are text-based and editable using a number of programs designed for the purpose (see http://drupal.org/node/ 11131 for a list of such programs).

Once you have downloaded the appropriate PO file from Drupal.org, you can import it directly into your web site from the import page (admin/locale/language/import). Select the file using the Language File field, and make sure to select the appropriate language (activated or not) from the list of languages in the Import Into field.

After Drupal has processed the file, you will see a report indicating how much of the base language was covered by the translation (the different translations are at different stages of completion). This information appears in the Translated column of the report, shown as a percentage of the total number of strings in the Drupal codebase. Importing a language that hasn't yet been activated adds the language, but it will still need to be activated. Any strings that were left untranslated after importing the PO file will be displayed in English. Figure 3-3 shows the Drupal interface after being translated into Japanese.

^ drupal

Figure 3-3. The Drupal interface translated into Japanese

Was this article helpful?

0 0

Post a comment