Exporting Strings

The documentation has moved

New Location https://project.pages.drupalcode.org/string/

Visit /admin/config/regional/translate/string-export on your site to download the translation source file containing all strings defined using string module's plugin system (i.e. inside *.string.yml)

Consuming strings in code

The documentation has moved

New Location https://project.pages.drupalcode.org/string/

 Impacts: 

  • Module developers
  • Themers

The main aim is to provide developers with the ability to define interface text in their codebase using custom identifiers. The developers can also provide some meta data surrounding the strings if needed.

For example,

Overview of localize.drupal.org

The text that you see in Drupal's user interface is in English by default, such as the "Log in" button and the "Add new comment" text. These pieces of text (or "strings", in programming terminology) are known as "user interface text" or "interface text". They are written into the software of Drupal core and add-on modules, themes, and profiles, and they can be translated.

Downloading and uploading translation files

If you want to translate user interface text for Drupal core or add-on modules and themes, you can do this on the localization.drupal.org site.

Editors for PO files

Here is a list of editors for PO files. Be sure to get a recent version for all editors, to make sure they have support for multiple plural forms, which are a relatively recent addition to the gettext standard.

Note that on Linux/Mac, you will probably also want to install the gettext package of command-line tools for PO files.

PO/POT file operations

Here are some commands that can be used to combine several PO translation files into one larger file, merge in translations from another source, and other operations. Most of the commands will run only on MacOS/Linux command lines, and require the gettext package to be installed.

Merging translations

Merging is the process of taking your existing translations and merging in new translations for the same strings from a new file, without losing your original translations. There are several ways to merge translations:

Pages

Subscribe with RSS Subscribe to RSS - localization