How to install a different language

Last modified: August 26, 2009 - 23:01

Multilanguage support is provided by the Locale module.

Drupal 6

Automatic translation import

Drupal 6 features automatic import of module and theme translation files for enabled languages.

For contributed modules and themes, translation files may be present in downloads.

For Drupal core, translations in many languages are available for download. After downloading, extract the translations into your root Drupal install directory (ie. /home/public_html/).

If you have command line access you should cd to your root Drupal install directory, download the translation tarball from Drupal.org & then decompress it with the following commands:

$ cd /home/public_html/
$ wget http://ftp.drupal.org/files/projects/fr-6.x-1.0.tar.gz
$ tar -xvf fr-6.x-1.0.tar.gz

Alternately, you may first extract the translations into a new directory and then copy the entire contents into your root Drupal install directory.

In either case, the result should be that you have /translations subdirectories containing translation files in the directories of various core modules and themes.

When a new language is enabled, all enabled module and theme directories are scanned for translations in that language and any translations found are imported automatically.

Similarly, when a new module or theme is enabled, translations are installed for all enabled languages.

Steps to install a new language:

  1. Install Drupal normally.
  2. Download a translation for the language you select, e.g., Spanish (es).
  3. Install and enable the additional language at Administer > Site configuration > Languages.

When you enable the new language, translation files will be imported automatically.

Manual translation import

Translations also can be imported manually at Administer > Site building > Translate interface > Import. Manual importing may be useful for importing translation downloaded after a module or language has been installed. Manual importing may also be used for moving custom translations from one site to another--first export a translation from site one, then import it on site two.

For ease of import, some site administrators choose to concatenate (join together) all translations to be used on a site and then import them as a single file.

Drupal 5

To install a locale, simply enable the locale module. Then, go to admin/localization and import a .po file that you downloaded from http://drupal.org/project/Translations. You should select the right language code in the popup menu. That's it!

You can now let user switch languages, or not, by activating more than one. Also, you could look in the tab "translate strings" in the localization module.

See Locale or internationalization support for more.

Drupal 6

ztyx - September 18, 2008 - 21:30

In Drupal 6 you rarely download a single .po file, but instead a bunch of them in a zip-file. Therefor there are other ways of importing a .po file than through the 'Import...' page.

This page both needs to be clear that its 1) more so about Drupal 4/5 or 2) should be updated to conform to Drupal 6 (#310451: Drupalcamp Copenhagen: "Importing/upgrading translation (using .po-files) in Drupal 6".

The Power of the shell

dereine - September 21, 2008 - 09:04

One solution is to bring ALL Po files into one, so you can import them as in drupal5

If you downloaded and extracted the tar.gz file of your translation

<?php
//open all po files and write theme into one file
cat translation_folder/*/*translations/*.po > translation.po

?>

As the result you can a full po file for your language
----------------------------------------
Blog: www.freeblogger.org: German IRC-Channel: irc.freenode.net #drupal.de ... Jabber-me: dwehner@im.calug.deXING

the power of the machine

Gábor Hojtsy - November 25, 2008 - 18:26

This method I'd not endorse. The translation files are separate for multiple reasons, two most important for users:

1. Smaller files can be imported in automated batch operations (multiple HTTP requests with a nice progress bar UI, such as the ones you see in the installer), so that loading of one huge files does not time out (definitely useful for smaller hosts).
2. Drupal only imports the translations you actually use, unused modules and themes don't get their strings into the database - this is a performance boost for sites of any size.

Drupal 6 translation

alexo007 - September 25, 2008 - 09:27

For information about translation in Drupal 6

http://drupal.org/node/202631

if youre a shell guy like

abaddon - November 5, 2008 - 02:46

if youre a shell guy like me, you can download the language file from the translations page, simply change into your drupal root directory and unarchive it, for the setup i have right now i would do

cd DRUPAL_SITE_FOLDER
wget http://ftp.drupal.org/files/projects/ro-6.x-1.1.tar.gz
tar xzvf ro-6.x-1.1.tar.gz

of course, i wouldnt recommend doing that directly into your drupal folder but if you dont know otherwise, its quick and painless
nothing is stopping you from uploading the files via ftp instead

[edit2]
_after_ this is done, go and add the extra language for your site in the drupal admin /admin/settings/language (for D6), in my case i just added romanian and it automatically imported all the translations i just unarchived into the database
im not sure what happens on an upgrade but since the translation files are there i guess theyll be reimported..

[edit2 - ignore the below..]
does anyone know which benefits either method has? importing via the web interface vs. extracting the files in place, is importing going to the mysql database? and extracting no?

[edit]
ive just read this on the next page, "Every time you upgrade a module to a new version, your text for that module is deleted from the database, and is replaced by the module's own translation." could this be one of the benefits of simply dropping .po files in place? drupal wont be able to delete them because i usually set them owned by root anyway..

For Drupal 6.8, note that

ball.in.th - January 5, 2009 - 11:27

For Drupal 6.8, note that translations will get auto imported only when a new language is added. This means if you've already enabled a language before extracting the translation files, it won't get auto imported. I had to delete the language and re-add to get auto import.
--
http://ball.in.th, http://บอล.th - ชุมชนคอบอลอันดับ 1 (ยังไม่ใช่ แต่เราจะไปให้ถึง 555)

 
 

Drupal is a registered trademark of Dries Buytaert.