Community Documentation

Translating a site interface into different languages (Locale core module)

Last updated August 9, 2012. Created by ghankstef on November 7, 2002.
Edited by Kristen Pol, jvns, August1914, Fiable.biz. Log in to edit this page.

When enabled, the Locale core module allows you to present your Drupal site in a language other than the default (English). You can use it to set up a multilingual web site or to replace the elements of the interface text with text which has been customized for your site. Whenever the Locale module encounters text, it tries to translate it into the currently selected language. If a translation is not available, the string is remembered, so you can look up untranslated strings easily.

For Drupal 6 and 7, you can install the Localization Update module to automatically retrieve translations from http://localize.drupal.org. For languages where translation has already been done, you do not have to do anything other than set up this module. This module will be included in Drupal 8 core.

The Locale module provides two options for providing translations. The first is the integrated web interface, which you can used to search for untranslated strings and to specify their translations. An easier and less time-consuming method is to import existing translations for your language. These translations are available as GNU gettext Portable Object files (.po files for short). You can download translation files from the Drupal translations server.

If an existing translation does not meet your needs, the .po files are easily edited with special editing tools. The Locale module's import feature allows you to add strings from such files into your site's database. The export functionality enables you to share your translations with others, generating Portable Object files from your site's strings.

Note: Enabling the Locale module itself does not create or add any translations to the site. You need to import translations or create string translations by using Translate Interface option (provided by the Content Translation module from Drupal core for Drupal 6 onwards).

Drupal 7

You can:

  • Administer languages: http://example.com/admin/config/regional/language
  • Manage strings for localization: http://example.com/admin/config/regional/translate
  • Specify how the desired languages are detected: http://example.com/admin/config/regional/language/configure
    or Configuration → Regional and language → Detection and selection
  • Translate strings: http://example.com/admin/config/regional/translate/translate
  • Import strings: http://example.com/admin/config/regional/translate/import
  • Export strings: http://example.com/admin/config/regional/translate/export

Drupal 6

You can:

  • Administer languages: Administer → Site configuration → Languages
  • Manage strings for the localization: Administer → Site building → Translate interface

Drupal 5

You can:

  • Administer localization: Administer → Localization
  • Manage strings for the localization: Administer → Localization → Manage strings
  • Add a locale language: Administer → Localization → Add language

Comments

I have enabled the Locale

I have enabled the Locale module in Drupal 7, but when I go to /admin/config/regional/translate/translate, I only see a few "Built-in interface" strings e.g. "An AJAX HTTP error occurred". How do I offer custom translations for interface strings passed through t() in contib modules (specifically Drupal Commerce)?

Edit: OK just realised you must add a second language here: /admin/config/regional/language and set it as default before you will see loads of translatable strings on that translate page.

I also highly recommend the Localization client which gives you a blue bar across the bottom of the page and allows you to see and edit all the translatable strings on the current page.

nobody click here