Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To configure Pathauto to have language-specific path aliases, do the following:
admin/build/modules: enable Locale and Content Translation modules
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)
admin/settings/language/add: add a couple of new languages - say French and Spanish
admin/settings/language/configure: change the 'Language negotiation' setting to 'Path prefix with language fallback'
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
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
node/add/story: create a new item of content, and set the language to English (or whatever your default language is)
node/NID/translate: click the Translate tab and then click the 'add translation' link for each language that you wish to have a translation
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".
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):
Enable the Variable translation module included with the Internationalization package
Go to Administration > Configuration > Regional and language > Multilingual settings
The work as translator is rather straight-forward. You will find your translation jobs in one of two ways:
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.)
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 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:
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.