Multilingual Guide in Drupal 8

Enable Multilingual modules

After installation, check if all Drupal 8 Multilingual modules are enabled. If not, enabled them

Menu: Manage > Extend
Path: /admin/modules#edit-modules-multilingual

Module:

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