String translation

The String translation module, part of the Internationalization (i18n) package, provides support for other modules to translate user-defined strings. It implements the i18n_strings function, which in Drupal 6 was commonly known as the tt function. The i18n_strings function is an API function that lets other modules (such as the Taxonomy translation and Menu translation submodules) manage translations of user-entered strings. Depending on which modules you have enabled that use this feature, different text groups will be available for translation.

In contrast to Drupal's standard localization system, which always translates from English, strings will be translated from the source language. By default the source language is the site's default language, so changing the default language could break these translations. You can set which language is used as the source language via Administration > Configuration > Regional and language > Multilingual settings > Strings.

Menu translation

With Drupal core alone, user-defined menu items are not translatable. The Menu translation module, part of the Internationalization (i18n) package, allows users to select a translation mode for each menu (Figure 1).

The following modes are available:

  • No Multilingual Options
  • Translate and Localize
  • Fixed Language


Figure 1

Translate and Localize Menus

For most use cases, and especially if the structure of your menus is consistent across languages, Translate and Localize is the preferred method of translating menus. You can create one menu for all languages, and translate or localize each menu item. There are two ways that menu items will be translated:

  • You can set a language when creating a custom menu item so that the menu item will only show up for that language (Figure 1). Menu items that link to nodes in a particular language will be treated this way.
  • You can localize other custom menu items without a language (for example, menu items linking to Views pages). Use the Translate tab to translate the menu item title and description (Figure 2). Translators can also use the 'Translate interface' pages to translate these menu items (Figure 3).

Menus and primary / secondary links

With Drupal 6 core alone, user-defined menu items are not translatable. The Menu translation (i18nmenu) module, part of the Internationalization (i18n) package, provides the following features:

  • Allows setting a language when creating a custom menu item so that the menu item will only show up for that language.
  • Localizes other custom menu items without language. It does this by adding a "Limit search to: Menu" option on the Search tab of the Translate interface at Administer > Site building > Translate interface.

A menu item linked to a node, due to how the menu system works and the 'Language selection' feature in the Internationalization module, will be displayed only when the node language matches the page language. The Menu translation module relies on theming and blocks for displaying the right links for each case. Thus for uses different than displaying the menu in a block, it may not always work.

About primary / secondary links

This is a special case, as they're basically menus that can be displayed as a block but aren't always. Most of the themes display them directly instead of using a block so, for this case, the Internationalization module's multilingual menu items features won't work.

Subscribe with RSS Subscribe to RSS - menu translation