Configure Pathauto to work with language-specific path aliases

To configure Pathauto to have language-specific path aliases, do the following:

  1. admin/build/modules: enable Locale and Content Translation modules
  2. admin/build/block: enable the language switcher block (this is required since your path aliases will only show in the currently active language, the rest will show as unaliased)
  3. admin/settings/language/add: add a couple of new languages - say French and Spanish
  4. admin/settings/language/configure: change the 'Language negotiation' setting to 'Path prefix with language fallback'
  5. admin/content/types: edit the content types that require translation and set the 'Multilingual support' setting to 'Enabled, with translation' - the setting is in the 'Workflow settings' fieldset
  6. admin/build/path/pathauto: add new, language-specific patterns for the node types, say article/[title-raw] for French and artículo/[title-raw] for Spanish
  7. node/add/story: create a new item of content, and set the language to English (or whatever your default language is)
  8. node/NID/translate: click the Translate tab and then click the 'add translation' link for each language that you wish to have a translation

Using the i18n API from other modules

If you want some of your module's strings and objects to be translatable using i18n API, there are some functions that need to be implemented.

Menu translation

Any module that displays a menu needs to provide a hook for i18n to be able to translate/localize it.

// If $tree is the menu tree to be displayed
if (function_exists('i18n_menu_localize_tree')) {
  $tree = i18n_menu_localize_tree($tree);
}

Multilingual variables

In order for your module's variables to be translatable they must be declared using Variable module hooks. If variables are declared using hook_variable_info() everything else will be handled automatically.

String translation

Internationalization module provides translation services for user-defined strings. It also tracks source strings and keeps them up-to-date using a 'string key' that is a string with these elements "textgroup:object_type:object_key:property_name".

Variable translation

The Variable translation module, part of the Internationalization (i18n) package, allows you to translate text and settings that are stored in Drupal as variables. These variables include text such as 'site name' and 'site slogan', as well as settings like 'Default front page' and 'Default 404 page'.

Dependency

The Variable translation module has a dependency on the Variable module.

Support for Contributed Modules

Variables provided by contributed modules can also be translated by the Variable translation module if they implement hook_variable_info(). For documentation, see the Variable module project page.

Usage

To enable multilingual variables (Figure 1):

  1. Enable the Variable translation module included with the Internationalization package
  2. Go to Administration > Configuration > Regional and language > Multilingual settings
  3. Click on the Variables tab
  4. Select the variables that will be multilingual
  5. Click Save configuration button

Figure 1

Working with translations as translator

The work as translator is rather straight-forward. You will find your translation jobs in one of two ways:

  1. As e-mail notifications sent whenever new translation jobs are assigned to you. The notification includes a link to the translation page for the relevant content, and also a link to the translation overview page. (The notifications may be disabled by site administrators, in which case notifications won't appear.)
  2. As a task on the translation overview page (found at the path example.com/translator). The page contains a list of all content on the website that has been, is being, or could be translated by you. On top of the page there is a filter option limit the list to content in any of these states – once the website has gotten a lot of content you will probably only show untranslated content or content where the translation is in progress.

Note: To access the translation pages you must be logged to the site using your translation user account.

The list of current translation jobs
The list of current translation jobs

Handle special language challenges using Language Sections

The Language Sections module may help address some requirements on your multi-language site which would be otherwise difficult to achieve.

Translation Dashboard - an overview of the site's translation status

The Translation Dashboard gives a full picture of translation status for the entire site.

It shows:

  • Nodes
  • CCK
  • Blocks
  • Contact forms
  • Interface strings

Here is how it looks like:

Translation Dashboard

The screen includes a display filter, list of contents and translation controls.

For example, you can display all English documents, that require translation. Or, you can view all documents written in English and translated to French and see their translation status.

The documents list shows the translation status per target language. These are the possible status values:

  • Translation complete - means that translation is up-to-date and doesn't require any work.
  • Not translated - there is no translation at all.
  • Translation needs update - the original has changed since it was last translated.
  • Translation in progress - the document was sent for translation and translation did not yet complete.

Pages

Subscribe with RSS Subscribe to RSS - multilingual