Usercentrics - PUBLIC

How do I set the language of the Usercentrics CMP version 1?

In this section we share with you our solution for implementing the adequate language(s) for your CMP. Usercentrics offers two main “modes” to set the language of the privacy banner. The customer can adjust the languages in the Admin Interface Configuration → Setup (CMP V2).

In this section we share with you our solution for implementing the adequate language(s) for your CMP. Usercentrics offers two main “modes” to set the language of the privacy banner. The customer can adjust the languages in the Admin Interface Configuration → Setup (CMP V2).

Note: In order for this walk-through to work, you need to have the relevant languages configured in your Usercentrics Admin Interface.

Overview


Attention: In the Admin Interface, the language highlighted in blue is the default language and cannot be removed. He should therefore put another language first and make it the default language. Then the former default language can be removed.

1. Strict Mode

Use Case

This mode is useful when operating region-/language-specific websites that should always be shown in a particular language.

Implementation

You can initialise the Usercentrics script directly using your language of choice. Please replace “language_code” with the code of the language that you would like to use1:

<script type="application/javascript" src="https://app.usercentrics.eu/latest/main.js" language="language_code" id="YOUR_SETTINGS_ID" ></script>

1 Please use the language code in ISO 639-1 format (https://en.wikipedia.org/wiki/ISO_639-1 ).

Explanation

The banner will always appear in the specified language. Nonetheless, you can alter the language of the banner by using the API call window.usercentrics.updateLanguage(“language_code“). However, upon reloading the page, the banner will again appear in the originally defined language.


2. Automatic Mode

Use Case

The automatic mode is useful when operating a single website that receives international traffic and that is available in several different languages. It allows website operators to dynamically determine which language the CMP should be shown in.

Also, this mode respects the user’s choice if the user changed the language via the language switch in the CMP UI, as the language is stored in the local storage and the CMP will be initialised with the language from the user’s local storage on recurring website visits.

Implementation

Implement your Usercentrics script without defining a language and let Usercentrics automatically determine in which language your CMP should be displayed:

<script type="application/javascript" src="https://app.usercentrics.eu/latest/main.js" id="Y

Explanation

Usercentrics follows a certain hierarchy to determine which language value should be used to display your CMP. The hierarchy is as follows:

  1. CDCS Local Storage (the user’s language preference is transferred from another website that is connected to the current website via Usercentrics' Cross-Domain-Consent-Sharing iFrame)

  2. Website Local Storage (the user’s language preference is already stored in the local storage of the current website because he/she has visited the page before)

  3. language <meta> tag (e.g. <meta http-equiv="language" content="language_code">is integrated on the website)

  4. lang-attribute on <html> tag (e.g. <html lang=”language_code”> is integrated on the website)

  5. the user’s browser language

  6. English

The language that the CMP chooses will be written into the local storage of the website and any Usercentrics element will be displayed in that language to the user during future visits.

Nonetheless, the language value can still be overwritten with the API call window.usercentrics.updateLanguage(“language_code“). The newly selected language will then be written into the local storage and will serve as the new “default” language for that user.


Summary



Do you need further help?

How can I get help with technical questions?



Usercentrics - PUBLIC