Layout Builder support

Overview

Layout Builder allows you to use layouts to customize how content, custom blocks, and other content entities are displayed on your site. Our connector for Drupal 8 and Drupal 9 is compatible with this useful module. Due to its complexity, we highly recommend you review this page before setting up Layout Builder and using our module to translate your content.

For more information, see the Layout Builder documentation. This Drupal issue includes technical notes about translation and the work being done to support different uses of Layout Builder.

Requirements

Plan ahead!

The symmetrical and asymmetrical modules are not compatible with each other. So, you need to decide in advance which module you will use.

Scenarios

Default layouts

Default layouts are those layouts that you define for a given bundle (e.g. a content entity type like articles) and are associated with their view modes.

Translating default layouts

Translating default layouts requires a Drupal core patch since the configuration of the layout (including block titles) is stored in the view mode, and view modes are not translatable in Drupal UI. You will also need the Lingotek patch attached to this Drupal Issue, which contains instructions on how to test the patch with our module.

  1. Go to the Lingotek config bulk management and go to the entity view modes.

  2. Roundtrip the view mode that contains your layout.

  3. You may need to clear your cache.

Referenced Blocks

Content blocks are not automatically uploaded to the TMS with content that references them. This is to prevent content blocks from being unnecessarily uploaded each time content that references them is uploaded.

Overridden layouts

If enabled, each individual content item can have a custom layout. Once the layout for an individual content item is overridden, changes to the Default layout will no longer affect it. Users can revert overridden layouts to their Default layout, after which the individual content will stay in sync with the default layout. Overridden layouts are stored as content in the layout field, see the following information to understand how you can translate that field.

Overridden Layout Requirements:

  • A known Drupal core issue prevents overridden layout block titles from being translated. This patch allows field blocks to display the configuration label in the layout builder.

  • Configuration schemas are mandatory for configuration blocks referenced in layouts so the Lingotek module can identify which data is translatable and which is not.

  • Enable content blocks in the Lingotek content settings and the fields you want to translate are marked as translatable.

  • The “layout field“ is not translatable for overridden layouts, so you need to use the Symmetrical Translation module or Asymmetrical Translation module.

    • The Symmetrical Translation module is used if you want all the translations to have the same layout, sections, and components.

    • The Asymmetrical Translation module is used if you want to choose different layouts and blocks for different languages.

Symmetrical Translation Module

  • The Symmetrical Translation module adds a “Layout Labels” field for storing translations, however, behind the scenes, it is storing translations in a way that doesn’t work like other fields.

  • Because of the way translations are stored, you cannot enable the “Layout Labels” field for translation in the Content translation settings.

  • You should enable the “Layout Labels” fields in the Lingotek translation settings so its values are uploaded to the TMS for translation.

Asymmetrical Translation Module

  • The Asymmetrical Translation module also adds a “Layout” field for storing translations, but it does work like other fields.

  • You need to enable this new “Layout” field for translation in the Content Translation settings.

  • You should also enable the “Layout” field in the Lingotek translation settings so its values are uploaded to the TMS for translation.