Change Languages in Drupal Sites
This week, an OSTraining member had a question about translating Drupal sites.
They installed their site in English, but then wanted to change to a different language.
This is our answer for that member. This tutorial will walk you through the process of changing the language used on your Drupal site.
- Go the Modules screen and enable the Locale module.
- Under Configuration, go to Languages. By default, you’ll see only the language that you selected when installing the site.
- Click Add language
- Choose the language you want to add. In this example, we’ll use French.
- Click Add language.
You’ll now see that French has appeared alongside English.
- Check the Default box next to French.
- Uncheck the Enabled box next to English.
Go to https://localize.drupal.org. This is where all of the Drupal translation files are stored.
- Click the French language link.
- You’ll see a download area like the one below. Click the Drupal 7 download link.
- You’ll get a file with a name like this: drupal-7.22.fr.po
Back in your Drupal site, go to Configuration > Translate Interface > Import
- Click the Browse button to find and import your downloaded French file.
Volia! Your site’s interface will now be translated.
If you want to know how to build complete, multi-lingual Drupal sites, try this tutorial.
If you want to translate individual language strings rather than the whole interface, try this tutorial.
If you want an insight into translation improvements in Drupal 8, try this tutorial.
Thanks for this, very helpful.
For those having problems downloading the file as .po file, rename the file as .po file right clicking on the new page that shows up after downloading.
Thanks Rodolfo. I popped an answer on the support forum for you on this.
Changing the default language like that has implications for translating the site. Once you change the default language, all data without language selectors on it, eg. views, content types, etc. will be understood as being in that language, so you will not be able to translate those to French. I would suggest using [url=https://drupal.org/project/fallback_language_negotation]https://drupal.org/project/…[/url] and setting the site display fallback language to French with that.
Thanks Gabor. That’s true for people with who want multiple languages. This was a more straightforward request from our site’s member … they had just installed Drupal in the wrong language.
Also, a productivity tip: downloading translations manually is tedious once you have a few modules installed and a theme or so. Then you need to identify version numbers and project names for each and manually download and import files. It is much easier to just go with [url=https://drupal.org/project/l10n_update]https://drupal.org/project/…[/url] which does it all for you automatically (including dowloading core translations). So no manual download and import/upload needed.
Thanks Gabor. That’s a useful tip. We’ll cover it in a future tutorial.