Freedom, Community & Sustainability

Seamless Drupal 7 multilingual site

November 7, 2011 -- William
Last modified on December 2018
Duration: +- 15 minutes

2 - Additional modules

Localization Update (strongly recommended)
To help keep your interface up to date with the languages provided by localize.drupal.org install the module Localization update. Once enabled you will see in /admin/config/regional/translate/update that a new tab “Update” is available. It allows you to update all your languages for all your modules with just one click. It will save you a lot of time. To check interface translations automatically go to /admin/config/regional/language/update and chose to check for updates daily or weekly.

i18n (strongly recommended)
The next module to install is i18n. It stands for “internationalization” (first letter “i” + 18 letters + last letter “n”). It will give a huge boost in your multilingual capabilities. You will have to install and enable the Variable module as well. Then enable Internationalization, and the other options you might want. This module allow you to translate your site name, site mission, forums, taxonomy, maintenance message, registration message and many many other things you probably will want translated.

Important notes:
-To configure what variables should be translated go to /admin/config/regional/i18n/variable and check everything you want to translate (“Variable translation” module must be enabled). The translation options will be available on the usual place for each variable. For example, if you select to translate the site name and slogan, you will have to go to /admin/config/system/site-information to translate the name and slogan.

-Be careful with the option synchronize translations. If setup incorrectly it can have catastrophic consequences. The idea here is to synchronize variables across languages. If you have a node that contains a picture it might be a good idea to synchronize the picture with all translated nodes. If you configure it to synchronize content (taxonomy, body, title...) you might end up overriding the original content with it's translation and end up loosing it.

Localization client
This module is a handy way to make “live” translations of your site interface. It allows you to translate text on the fly while you are browsing your site. Translations made with this module can also be uploaded to localize.drupal.org so you will be contributing to the translation of Drupal and helping the international community. The module displays a translation bar at the bottom of every page (except on the default language of course). If you don't have this module you can go to admin/config/regional/translate/translate to translate strings of your site interface.

Global Redirect
I have mentioned already Global Redirect when talking about detection and selection. This module is important to enforce language consistency throughout your site and to help determine the correct URL for SEO purposes. Apart from selecting the best URL for each content (and avoid mixing up languages) it will add HTTP status codes to inform search engines that a 301 redirection is being performed and thus optimizing how your site is indexed. 'Global Redirect' is being merged with the excellent module 'Redirect' but features have not been fully ported yet.

Translation Management Tool
This module replaces the two modules that I used to recommend in the past. I left both at the bottom as a reference because they are still good and functional. This module (tmgmt) allows you to send translations to human or machine translators while it gives you a nice overview of your progress. It's a great tool for translation collaboration and enhance productivity. It also automates the translation of menus, creating multilingual menus when nodes are translated.

Translation overview
This is a neat module to have an overview of your content and your translations. It shows a white or a black square for translated or untranslated nodes respectively. It's a great way to know at what point you are with your translations and what are the priorities.

 Translation management (Not maintained)
This module is perfect if you have several translators. It will ease the task of the administrator to assign translations to each translator and follow how the work is evolving. It is also nice for the translators because they will have a simple interface and won't need to learn how to administer Drupal.

There are many other modules to choose from and you don't need all of them. I would strongly recommend though to have at least Localization Update, i18n (and Global Redirect for consistency).

3 -  Fine tuning

Once your site is multilingual there are some small adjustments that are important to make.

Switching languages
The first one is to add the Language switcher block to your site so that users can change the language. Go to /admin/structure/block and add the block Language switcher to the region you want. There is a nice module to display the language switcher as a drop down list called Language switcher dropdown. You might also want to display a flag, together or instead, of the language name. The module Language icons helps you do that easily. At this point you might want to disable the links to other languages that appear at the bottom of every node. Make sure that the module “Multilingual content” (i18n) is enabled then go to /admin/config/regional/i18n/node and select “Hide content translation links”.

Translating menus
Menus can be tricky to translate because there are many different ways to do it. Keep in mind that menus have a name (like 'main menu') and items (the links in it, like 'Home'). When you go to the menu configuration and chose to make it translatable, you are basically translating the menu name. Then you need to go into every link in that menu and translate them too (or you could add nodes to a menu when editing a node). Items in a menu can also be 'Language neutral' and appear in all languages (double check this if several languages appear in your menu). Once you do the translations you will notice in your administration area that your menu contains the links for all languages. This can be confusing and hard to manage. For this reason some webmasters prefer to have untranslated menus and create a new menu for each language just to keep things separate. Before translating your menu, make sure you understand how this works and chose the right approach for your project. Taking the time to study can actually save you a lot of time.
i18n menu translation documentation
Translating menus manually (without the translation management module)

Machine translations on the fly
There is another module that proposes machine translations of your live site on the fly. It is not as good as a human translation but it might allow some users to access your content in other languages than the ones you offer. It is called TranslateThis button.



If you enable the i18n_redirect module (from the i18n module suite), then you can use language neutral nodes without penalty of having duplicate content on your site.

Submitted by William on
Hello Kristen, Thank you for pointing that out! I've added a note on the text about your comment. Thank you for mentioning this tutorial in your site! ;) I'll also take the opportunity to mention to other readers that you wrote a very good book about Drupal multilingual websites! http://www.packtpub.com/drupal-7-multilingual-sites/book

...only works for anonymous users when page caching is turned off. This is to prevent cached pages being served in the wrong language. For example if an Italian visitor has visited a page, and a french visitor comes next, the French visitor would be serves the page in Italian from the cache. This is bad, of course, since caching should almost always be turned on :-(

Submitted by William on
Hi Reinhard, Thank you for this information, I'm just wondering what is the detection method you are using in the URL? I think this is likely to happen when using the Session variable but not when using path prefix. Do you have also the Global Redirect module enabled? I haven't tested to check these issues but I was just wondering. Anyway, I've added a note about your comment in the text. Thanks again!

Submitted by Soulemane (not verified) on
Hi! I am about to develop a multilingual web site : english, french and arabic. I have been trying to find out how I will carry out this critical project, giving that it is my first one with multilingual site. After reading your article I felt a huge relief. I am therefore taking this opportunity to extend you my gratitude. You have done a good job. It has just saved me a lot of time. Keep it up. Thanks

Submitted by William on
Hi Soulemane, Thank you for your comment, I'm really glad it was helpful! I'd be curious to know how your multilingual project went!


Add new comment