[Drupal] How to implement multi-language feature for a website?

| | 2 min read

The way Drupal manages translation have been advancing over several versions. Drupal requires the combination of core & contributed modules to make a site multi-lingual. We will be using Drupal 7's content translation method. One challenge you will be facing is to translate the content into the languages needed. There are lots of tools available for this online like google's translate. Using this method, for example, Arabic node will hold all Arabic values and English node will hold all the English values.

Let us see how we could implement this feature to a Drupal 7 site with English as default language. We need the basic modules to be installed in our site to set-up multilanguage. The modules required are as follows:

  • Internationalization (i18n)
  • Pathauto
  • Token
  • Transliteration
  • Variable
  • Chaos Tools
  • Views
  • Internationalization Views

Make sure the following modules are enabled. In the core section Contact, Locale, Content translation modules should be enabled. Chaos tools should be enabled as well. Under Multilingual - Internationalization following modules should be enabled Block languages, Contact translation, Internationalization, Menu translation, Multilingual content, Multilingual select, String translation, Synchronize translations, Taxonomy translation, Translation sets, Views translation. Also modules such as Pathauto, Token, Transliteration should be enabled.

If you have configured the modules correctly now lets move on to adding languages. To add a language go to Administration > Configuration > Regional and langauge > Language > Add Language, select the language from list and save. After saving click on the tab 'Detection and selection' click 'URL' enabled. Make sure 'URL' configuration is set to 'path prefix'.

To add language switching block goto admin > structure > blocks, select the region for 'Language switcher' block.

Now you are half done, the above steps alone won't make your sites multi-lingual. We need to say each of the sites content types translation is enabled, for that got to admin > structure > content types, select the type or on adding new content your could notice a section called 'Multilingual support', ensure that 'Enabled, with translation' is selected.

On adding a new content you will be getting a language drop down with 3 option, 'Language neutral, your default language, new added language'. Select the language you needed after adding the content, click translate link insert the translated version of your record. If langauge switcher block is added you could test by switching between the languages.

Hope you found this article useful, please feel free to write in any question or suggestions for further improvement. Thank you.