Setup a Multilingual Drupal Site

From OSF Wiki
Jump to navigation Jump to search

In this section, we will cover all the steps to perform to setup the baseline required to have enable the multilingual support of the OSF for Drupal modules.

One of the core set of Drupal Multilingual tutorials has been written by Gábor Hojtsy and is available here.

Enable the Local Module

The first step is to enable the Local module. This module is part of Drupal Core:

Multilingual 1.PNG

Once you checked the checkbox, save the modules settings.

Enable a New Language

The next step is to enable a new language in the Local settings. Go to the Regional and Language settings, and click the Languages link.

Multilingual 2.PNG

Then click the Add langauge link to add a new language that you would like to handle in your OSF for Drupal portal.

Important Note: make sure that the language you are adding in Drupal is supported by OSF. You should read the Multilinguality Capabilities of OSF documentation before continuing with this tutorial.

Multilingual 3.PNG

Once you click the Save configuration button, your Drupal instance will now be aware of the new language you just configured.

Update Language

Now that you handle a new language in Drupal, the next step will be to update the language packages available for this language. The first thing you have to do is to download the l10n_update Drupal module, and to enable it.

Once this module is enabled, you will go to the Configurations, and then click the Translate interface link.

Multilingual 4.PNG

Then you will click the Update tab.

Multilingual 5.PNG

What this section does is to help you adding and updating the language packages of all the modules you currently have on your Drupal instance, with the languages you selected previously. There you will have to choose update options that best fits you needs, and click the Update translations button.

Setup Language Detection

The next step is to choose how you want Drupal to detect the language to use to display the content into generated Drupal pages. There are multiple options to do that. Go to the Languages configuration section:

Multilingual 2.PNG

Then click the DETECT AND SELECTION tab:

Multilingual 6.PNG

Finally choose the mechanism you want to use to do this detection.

Install and Enable the i18n Module

The next step is to download and enable the i18n (internationalization) module. This module gives access to a series of multilingual API functions, and a multiple of user interfaces that will help us properly managing the multilinguality capabilities of Drupal.

Once the internationalization module is enabled, you should also enable the following modules:

  1. Block languages
  2. Field translation
  3. Menu translation
  4. Multilingual support
  5. Multilingual select
  6. Path translation
  7. String translation
  8. Variable translation

Enabling Multilingual Support for Every Content Type

The final step that will be required is to edit all the content type that you currently have on your Drupal portal, and to enable the multilingual capabilities of each of them that you want to translate. What you have to do is to edit one of the content type (the Page content type in this example):

Multilingual 7.PNG

The you have to click the Publishing options vertical tab. Finally you have to enable (with translation) the content type.

Once all these steps are done, you will be able to translate all the content types pages on your Drupal instance. However, this is out of the scope of this article. If you want more information about doing this, we strongly suggest you to read Gábor Hojtsy's series of articles covering these questions in details.