Installing and Choosing Modules for Multilingual in Drupal 8

Drupal 8's Multilingual improvements

When you install Drupal 8, the first choice you'll need to make is to choose the base language for the installation. The installer will attempt to make a reasonable choice based on your browser language, and should display the page in your browser language. If you are making a multilingual site, choose one of the languages that you will be using as the installation language, and preferably not English (a non-English choice will cause some modules you'll need to be installed).

Multilingual Messages

The Message module supports the creation and rendering of messages in multiple languages. To implement multilingual messages you should enable the core Locale module and the Localization Update module.

The example below shows the French equivalent of the message text used in the Creating Message Types page. Refer back to the Message Schema page to see how multilingual message text fields are stored in the database.

Use Suggestions

TMGMT includes a mechnism to detect content dependent on the source you are about to translate. You can, therefore, let the system suggest additional elements for which to create translation job items.

Let's look at an example. Assume you are using the Media module to manage your media content. And you use the File Entity Module to have your uploaded files registered as an entity. These will have 2 standard fields attached to them (Alt text and Title text).

Translating a node with an image file attached to it will also require to translate those additional fields. Thats where suggestions come in.

To demonstrate this, set up the following modules and types:

  • install Media module, version 2 (requires file entity, latest dev version, min. version 2)
  • activate entity translation for 'file' entity type (Administration > Configuration > Regional and language > Entity translation)
  • activate translation for the fields attached to the image file entity ( Administration > File types, choose 'manage fields' for Image, edit each field and check the 'Users may translate this field' box )
  • setup a content type with an image field. Make sure to choose 'Media File Selector' as the widget for the image field. Use 'Rendered file' as the display formatter on the image field

i18n String Translation

The TMGMT method can be used to translate i18n strings. It uses all the mechanisms defined by i18n.

Once you turn on all the necessary modules (i18n, string translation, menu translation, block languages, taxonomy translation etc.), the chosen strings will show up on the Admin > Translation > Sources page. In our case Blocks, Menu and Taxonomy strings.

Using the Local Translator

In TMGMT you can choose the Local Translator to submit a translation job to. During checkout, you can assign the job to a specific user or leave the choice to the translate administrator. Once the job is submitted, close the TMGMT overlay to return to a normal page.

With the Local Translator installed, new links are added to the user menu (top right of the screen in Bartik). Depending on the permissions, the 'Translate' and/or 'Manage Translation Tasks' links will be visible.

Choose the 'Translate' link. You will be presented with an overview of all translation tasks available to you. You can assign the jobs to yourself to proceed with the translation.

Choose the 'view' link to see the task items available for translation.

When clicking on the 'translate' link, you will (finally) get to the actual translation to be done.

Each data item (Title, Body, fields etc.) has its own pane. When finished with the work, it can be checked off. This is for administrative purposes only and has no influence on your ability to save and complete the task at hand.

Pages

Subscribe with RSS Subscribe to RSS - multilingual