Last updated November 5, 2012. Created by Jose Reyero on April 2, 2011.
Edited by frederickjh, pixelite. Log in to edit this page.

The String Translation module (i18n_string.module, part of the i18n project) allows translation of user-defined strings. This is an API module (that is, it doesn't do anything by itself) that must be enabled only when required by other modules in the Internationalization package.

Module developers: See how this can be used in other modules without introducing new dependencies: Using the i18n API.

The string translation UI is integrated into the localization system. All strings will be translatable through the Administer > Site building > Translate interface

You must decide on the site default language before using this feature. Changing it later will garble all your user defined strings translations. Read below!

About Drupal Strings

The Drupal localization system allows translation of hardcoded strings, using locale module and .po files. However, user-defined strings (menu items, taxonomy terms, field names, etc.) are not translatable using Drupal 6 core. This is why the Internationalization package includes its own string translation layer, which keeps track and allows translation of most user-defined strings.

String Translation

This module collects and keeps up-to-date user-defined strings so they can be translated using the standard translation page provided by Locale module: Administer > Site building > Translate interface

There are some key differences between standard localization and string translation:

  • The source strings to be translated must be defined first using the site's default language, which is not necessarily English
  • It uses Text groups to group strings. When using the Translate Interface screen at admin/build/translate/search you'll see different (searchable) groups under the "Limit search to:" heading: Taxonomy, Profile, Menus, etc.

The searchable text groups are provided by the i18n package.

About the site default language

When translating user-defined strings, the source string is stored using the site default language instead of English. If the default is other than English you will be able to import/export English translations too using the localization interface.

Warning: Whenever you change the default language, you'll need to manually recreate all the source strings so they are defined in that language. This means you may need to edit all your menu items, (localizable) taxonomy terms, etc.. The translations for other languages will be kept. Thus you need to decide your default language early on, when setting up your site. Changing the default language back and forth is unsupported and strongly discouraged.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Can you point me to an issue where this was discussed? I have some feedback but it doesn't belong in documentation :)