Localization

Notes on Drupal Localization

These are notes about localization using the Drupal Locale module. Much of this was jotted down while reading Pro Drupal Development by John VanDyk and Matt Westgate. It is a good book. You should buy it.

When using the GUI for managing strings, first visit a page with the string question to insure it is passed through t().

List of programs for working on .pot (Portable Object Translation) and .po files: http://drupal.org/node/11131.

Definitive .pot files for Drupal: http://drupal.org/project/drupal-pot.

Translation template extractor: http://drupal.org/project/potx.

The goal of the Translation Template Extractor project is to provide command line and web based Gettext translation template extractor functionality for Drupal. These translation templates are used by teams to translate Drupal to their language of choice. There are basically two ways to use the contents of this project:

  • Copy potx.inc and potx-cli.php to the directory you would like to generate translation templates for and run php potx-cli.php. The translation templates will get generated as separate files in the current directory.
  • Install the module on a Drupal site as you would with any other module. Once potx module is turned on, you can go to the "Extract strings" tab on the Locale administration interface, select the module or modules you want to have a translation template for, and submit the form. You will get one single template file generated.

The command line functionality is quite mature now, because it was basically carried over and refactored from extractor.php, previously hosted as part of the translation templates themselfs. The web based functionality is still in its early stages.

The installer does not have access to t(), but it can use st().