Are you looking for the latest documentation?

Documentation for Acquia Cohesion V6.0 onwards has moved to

    Translating strategies with DX8

    When translating a your DX8 website there are two different approaches that you can take. 

    Approach 1

    Your website is very similar in all languages apart from minor differences. In this case, you can use the Interface translation as described in Translating DX8 templates documentation, with a mix of using context visibility as explained in Displaying elements on specific languages and component content.

    A use case for this approach is that you have a logo in your header which is different per language. It is recommended to define a single component and add it to your master template, then make that component a component content. You can then translate this component content and change your logo image per language.

    Another use case would be, that the menus are specific per language. Create two different menus, add those two menus using the DX8 menu element in your master template, and then use the context visibility tab as explained in Display elements on specific languages to display one or the other depending on the current language.

    Approach 2

    Your websites have big differences between languages and it would become very messy to use the Context visibility tab approach. In this case, you can alter the template suggestions hook_theme_suggestions_HOOK_alter to display specific DX8 content template per language. You can create multiple full view mode content template (one per language) and alter the suggestion so that the default template is not the one defined by DX8 but the one you want per language. Although you could potentially do the same for the master template, it is recommended to use the master template select on content template rather then an alter hook.

    It is currently not possible to add multiple templates for view modes other than the full view mode. Although you can create a full view mode template and alter the suggestions to use this template to be used for a view mode other than full.  

    Approach 3

    You can mix Approach 1 and 2 if for example your header in the master template is very different per language but the core content is similar. Then you can use Approach 2 for your master template and alter the suggestions at the page level, and take Approach 1 for your content template.

    DX8 knowledge base icon

    Frequently asked questions

    Get instant answers to common questions. Available online 24/7.

    Find answers

    Raise a ticket icon

    Raise a support ticket

    To raise a ticket, sign into Acquia Cloud and select Help in the top menu.

    Raise support ticket


    Copyright © 2020 Acquia, Inc. All Rights Reserved. Drupal is a registered trademark of Dries Buytaert.