Optimizely: What determines which language combinations are present in an XTM Cloud project?

Introduction

When you use the XTM Connect – Optimizely plugin to submit content for translation in XTM Cloud, you can adjust some basic configurations for your XTM Cloud project. Apart from selecting the actual content, or an XTM Cloud project template, in the XTM Connect → Add content section, you can also select the source and target languages, directly in the CMS.


How does it work?

General rule

It is important to know that the source and target languages that are available, and subsequently used for a particular project in XTM Cloud, do not depend on which languages have been selected in a specific XTM project template but whichever source and target languages have been selected in the Optimizely CMS, during the content submission stage.

Important to note: XTM Connect – Optimizely takes whatever languages have been configured for a particular environment in the Optimizely CMS and completely ignores the languages selected in an XTM Cloud project template.

For example, if a selected environment has the following languages:

  • English (United Kingdom), Polish and German (Germany),

and a selected project template has:

  • source: English (United States) and

  • target: Polish, Spanish (Spain),

the only languages available during the content submission process will be English (United Kingdom), Polish, and German (Germany). All of them can be selected either as source languages (provided that the content involved exists in a particular source language in the CMS) or target languages.

All of the languages that are displayed during the content submission stage must first be configured in the Optimizely CMS. Select Admin → ConfigManage Website Languages. In the Manage Website Languages screen, click the Add Languages button to add a new language to the system.

IMPORTANT!

For a particular language to be available as either a source or target language, it must not only be added to the CMS but also enabled:

IMPORTANT!

For a particular language to be available as either a source or target language, it must not only be added to the CMS but also enabled:

Language mapping

The XTM Connect – Optimizely plugin enables flexible mapping of the CMS languages with XTM Cloud languages. By default, when the connector is installed, each language that is added to the Optimizely CMS must be mapped to a particular XTM Cloud language. Otherwise, if we select any unmapped language either as a source language or a target language, the following error message will be displayed after an attempt to submit content for translation in XTM Cloud:

This mapping must be performed in the XTM.config file, in the <LanguageMaps>element (click here to learn more about the file itself).

These are sample language mappings of some of the common locales, where the key attribute indicates a language code for a CMS language and the value attribute presents the language code for an XTM Cloud language.

<LanguageMaps> <LanguageMap key="en" value="en-GB" /> <LanguageMap key="es" value="es-ES" /> <LanguageMap key="de" value="de-DE" /> <LanguageMap key="pl" value="pl-PL" /> <LanguageMap key="fr" value="fr-FR" /> </LanguageMaps>

The Optimizely CMS itself offers its own list of languages but the range of language variants to choose from might not be satisfactory to you, so you might need to configure a different, specific mapping. For instance, if you want to use the Optimizely English (USA) language variant as English (Belgium) in XTM Cloud, you can do so. Use this setting: <LanguageMap key="en-US" value="en-BE" />.

IMPORTANT!

Note that, for any changes made to the XTM.config file to be effective, you need to restart your Optimizely CMS.