The Translation template extractor provides a web based and a command line Gettext translation template extractor interface for Drupal as well as a reusable API to look for translatable strings and translatability errors. This tool is used under the hood at as well to serve as a parsing machine for project releases.

Translation templates are used by teams to translate Drupal to their language of choice. There are basically three ways to use the contents of this project:

  • Web based extraction: If you are a translator, 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 theme you want to have a translation template for, and submit the form. You will get one single template file generated.
  • Web based code review: If you are a module or theme developer, install this module and the coder review module. Pick the Interface text translatability review offered by potx and check your module for translatability problems.
  • Command line extraction: Copy 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. Use php potx-cli.php --help to get a list of command line options.

Seeing a white screen?

If you only get a white browser screen as response to the extraction request, the memory limit for PHP on the server is probably too low, try to set that higher or parse a smaller number of modules at once.

Project Information