Internationalization

A comprehensive collection of modules that extend Drupal core's multilingual capabilities to build real-world multilingual sites.

i18n
49,501 sites
25
drupal.org

Overview

The Internationalization (i18n) module is a feature-rich package that significantly extends Drupal 7's core multilingual support. It provides a complete framework for building truly multilingual websites with features including translatable taxonomy terms, multilingual variables, translatable blocks with language visibility controls, content filtering by language, menu translation, and field property translation.

This module serves as both an API foundation for other multilingual modules and provides administrative interfaces for configuring various internationalization settings. It introduces concepts like translation sets for linking translated content, string translation for user-defined strings, and content selection modes that filter content based on the current language.

The package consists of a base module and numerous submodules, each addressing specific multilingual needs. Site builders can enable only the submodules they need, making it flexible for various multilingual scenarios from simple localized sites to complex multi-language content management systems.

Features

  • Taxonomy translation with four modes: language-independent, language-specific, localizable terms, and mixed-language vocabularies
  • Multilingual variables that switch values based on current page language (site name, slogan, front page, etc.)
  • Block language visibility controls and optional block title/content translation
  • Content language selection that filters nodes and taxonomy terms by current language
  • Menu translation with support for translatable menu items and language-specific menus
  • Translation sets API for linking related translations of various object types
  • String translation system for translating user-defined strings like field labels, node type names, and descriptions
  • Field property translation including labels, help text, default values, and list options
  • Synchronization of fields and taxonomy across node translations
  • Path translation for creating language-specific URL mappings
  • Extended language options for content types with current language defaults, required language, and locked language settings
  • Language switcher link enhancement with translations pointing to correct paths
  • User email translation capability
  • Forum multilingual configuration for translating forum names and containers
  • Context language detection based on current content being viewed

Use Cases

Corporate website with multiple language versions

A company needs their website in English, French, and German. Enable i18n, i18n_node for content translation controls, i18n_menu for translated menus, i18n_variable for translated site name and slogan, and i18n_block to show language-specific blocks and hide others.

E-commerce site with translated product categories

An online store uses taxonomy for product categories. Enable i18n_taxonomy with 'Localize' mode to translate category names and descriptions through the translation interface, while keeping the same term structure across languages.

Multilingual blog with region-specific content

A blog wants some posts available in all languages while others are region-specific. Enable i18n_select to filter content by language, i18n_node for translation workflows, and use taxonomy terms with language for regional tagging.

Community site with translated forums

A community platform needs forums in multiple languages. Enable i18n_forum along with i18n_taxonomy to translate forum names and containers, allowing users to see forums in their preferred language.

Government portal with strict translation requirements

A government site requires all content fields to be synchronized across translations. Enable i18n_sync to keep fields like publication date, attachments, and certain taxonomy terms synchronized when editors create translations.

Multi-site with shared content but localized settings

An organization runs sites for different countries with shared content but localized settings. Use i18n_variable to have country-specific site names, contact information, and error pages while sharing the content structure.

Tips

  • Start with only the submodules you need - the package is modular by design
  • Set up languages and default language correctly before adding content
  • Use 'Localize' mode for taxonomies when you want the same term structure across languages but translated names
  • Use 'Translate' mode for taxonomies when you need completely different term sets per language
  • Enable i18n_select to ensure listings only show content in the current language
  • Test the language switcher behavior thoroughly, especially with aliased paths
  • Consider translation workflow needs when choosing between node translation and entity translation approaches
  • For complex multilingual requirements, read the handbook at http://drupal.org/node/133977
  • Use the 'Refresh strings' function after enabling new modules that provide translatable strings
  • When using i18n_sync, carefully choose which fields to synchronize to avoid overwriting intended differences

Technical Details

Admin Pages 6
Multilingual settings /admin/config/regional/i18n

Main configuration page for extended multilingual options. Provides access to various i18n settings through local task tabs.

Node options /admin/config/regional/i18n/node

Configure extended options for multilingual nodes including interface switching during translation and translation link visibility.

Strings /admin/config/regional/i18n/strings

Configure which text formats are allowed for string translation. Important for security as some formats may allow dangerous content.

Selection /admin/config/regional/i18n/select

Configure content filtering by language. Controls which content types are filtered and on which pages the selection is active.

Variables /admin/config/regional/i18n/variable

Select which site variables should be multilingual. These variables will have different values per language.

Strings /admin/config/regional/translate/i18n_string

Refresh and update user-defined strings for translation. Use to rebuild string lists or import existing translations.

Permissions 3
Translate user-defined strings

Allows translating user-defined strings created as part of content or configuration

Translate admin strings

Allows translating administrative strings with permissive XSS/HTML filter. Restricted access.

Administer content translations

Allows adding or removing existing content to/from translation sets

Hooks 12
hook_i18n_object_info

Provide information about object types handled by the i18n system. Defines how objects can be translated including string properties, translation set support, and administrative paths.

hook_i18n_object_info_alter

Alter i18n object information provided by other modules.

hook_i18n_translate_path

Provide translation information for specific paths. Returns translated paths for the language switcher.

hook_i18n_translate_path_alter

Alter path translations provided by other modules.

hook_i18n_context_language

Provide the current context language based on page content. Used to determine what language should be used for certain operations.

hook_i18n_string_info

List text groups for string translation. Defines which string groups are available and their properties.

hook_i18n_string_list

Provide a list of translatable strings for a text group.

hook_i18n_string_list_TEXTGROUP_alter

Alter the string list for a specific text group. Called both per-object and for the complete list.

hook_i18n_string_objects

List objects to collect translatable strings from. Alternative to hook_i18n_string_list.

hook_i18n_translation_set_info

Provide information about translation sets and involved objects. Defines how translation sets are stored and managed.

hook_i18n_sync_options

Provide information about which fields to synchronize for each entity type.

hook_i18n_sync_translation

Perform additional synchronization operations on translated entities.

Troubleshooting 7
Translations not appearing for user-defined strings

Ensure the source language is correctly set at admin/config/regional/i18n/strings. Use the 'Refresh strings' feature at admin/config/regional/translate/i18n_string to rebuild the string list. Check that the text format is allowed for translation.

Changing default language breaks translations

String translations are stored relative to the source language. Changing the default language after content is created can break translations. Set the correct source language in string translation settings and avoid changing it after translation work begins.

Block translations not showing with Context module

The Context module conflicts with i18n_block as both alter block rendering. Track the issue at http://drupal.org/node/1343044. Consider using block visibility settings instead of Context for language-based block display.

String format errors when translating blocks

Enable the text format for translation at admin/config/regional/i18n/strings. After enabling formats, refresh strings to update the translatable string list.

Menu items not appearing for certain languages

Menu items linked to nodes only appear when the node language matches the page language. Ensure translated nodes exist and that menu items are properly configured with language settings or set to 'Localize' mode.

Taxonomy terms not being filtered by language

Enable i18n_select module and check that taxonomy filtering is enabled at admin/config/regional/i18n/select. Ensure vocabulary is set to a multilingual mode in the vocabulary settings.

Variables not switching with language

Ensure the variable is selected as multilingual at admin/config/regional/i18n/variable. Check that Variable module's variable_store and variable_realm submodules are enabled. The language realm must be properly initialized.

Security Notes 4
  • Be careful when allowing text formats for string translation - formats like PHP Filter or Full HTML could allow translators to inject malicious code
  • The 'translate admin strings' permission uses a permissive XSS filter and should only be granted to highly trusted users
  • Review import sources when using bulk translation imports as they bypass format access checks
  • After changing allowed formats for translation, refresh strings to remove potentially dangerous strings from the translation interface