Translation process overview

Last modified: July 29, 2009 - 23:18

The interface translation of Drupal and contributed modules/themes is a separate process from the development of these projects themselves, and it is also separate from translating content that is entered into Drupal (such as nodes, blocks, taxonomy terms, etc.). This page describes the process of interface translation.

Translation process

There are several steps involved in translating the interface of Drupal or a contributed module. First, developers of Drupal and the modules/themes make sure that all of their user-interface text is in English, and wrapped in Drupal translation functions such as t(). Next, a developer runs an extractor program, which collects the strings that need translation, and puts them into an industry-standard (GNU Gettext) formatted file. (Because Drupal uses custom markup for identifying text to translate, we provide custom tools to generate Gettext translation templates.) Once the Gettext templates have been generated, any one of many Gettext-compatible translation tools can be used by a language expert to translate the user interface text from English into other languages. Finally, Drupal can import the Gettext translation files for the Drupal core and contributed modules/themes, for the language(s) on your site, and once those are supplied, Drupal will display the user interface in your preferred language(s).

The diagram below illustrates this translation process for both Drupal and contributed modules (click on the image for a larger view):

Drupal translation processes

Drupal core translations

To offer a consistent base to work with, we generate the Drupal core templates for every Drupal release, so translators can download the pregenerated translation templates and work with their translation tools to finish the translation. For new releases of Drupal, the template files are first generated when Drupal is almost ready for release, so that translators will not need to redo work needlessly. Since much of the user interface text is preserved between releases of Drupal, it is often best to start translating a new version of Drupal by importing a previous version's translations -- see the Recycling old translations page for more information on how to do that. Note that although the translation templates for Drupal have a .pot extension, your translation file should have a .po extension.

You are encouraged to submit your translation to drupal.org so that others can make sites in your language too. The release management system on this web site will take care of packaging your translation file for release. If your language does not yet exist in our system, you can create a new translation project by adding a directory with your language code to the contributions repository under directory "translations", and then adding a project on the drupal.org web interface. If you don't have a CVS account, create an issue against the Translation templates project and upload your translation files there. Some helpful developer will hopefully come by and put them into CVS for you. In this case a project for your translation will be created, and you will be made the maintainer. Finally your translation will become available on the download page.

Contributed Drupal module/theme translations

Contributed module/theme (called module from now on) interface translations are a bit more complex than core Drupal translations, because the translation template (POT) files are not generated automatically for you. Some developers generate translation templates for their modules, and put them into their module's translations directory. This is a nice gesture, but unfortunately these templates get outdated quickly. So it is advised that you generate fresh templates with the translation template extractor when you start translating. Translations of modules should be placed, along with the POT file, in the 'translations' subdirectory of the module. If you are not the module maintainer and you have created a translation, submit an issue against that module and attach your module files so the maintainer can add them to the project.

Read more:

 
 

Drupal is a registered trademark of Dries Buytaert.