Home > Docs > GDPR Cookie Consent(Legacy Version) > Translating GDPR Cookie Consent Plugin with WPML

Translating GDPR Cookie Consent Plugin with WPML

Last updated on August 29, 2024

GDPR Cookie Consent plugin is compatible with some of the most common multilingual plugins like WPML, Polylang, qTranslateX etc. In this article, we will share deep insight into how the GDPR Cookie Consent plugin can be translated into your desired language via WPML.

First of all, install and activate the WPML plugins. Next, configure it for the desired languages. Then, navigate to WPML > String Translations as shown below for customizations w.r.t the plugin:

WPML-String Translation

From the String Translation page that opens up, you will get an option to choose the Select strings with domain drop down. The Select strings with domain drop down consists of two options pertaining to the GDPR Cookie Consent plugin:

  • admin_text_CookieLawInfo-0.9: You can assign translations for all editable text content by selecting this domain.
  • admin_texts_cookielawinfo_privacy_overview_content_settings: To translate the privacy overview text content, you can select this domain.
  • cookie_law_info: You can assign translations for non-editable content like the label, validation messages, pop-up content, etc. by selecting this domain.
Select strings within domain drop down

Case 1: For editable texts

On selecting admin_text_CookieLawInfo-0.9 from the Select strings within domain drop-down, the screen will be as shown below:

List of strings for translating

To translate the string Privacy and Cookie Policy follow the below steps.

  1. Click on the translations link, enter the translation text in respective languages as shown below:
Click on translations

Note: As per the above screenshot, Danish (da), French (fr), and German (de) are the configured languages in WPML.

For example, 

  • Privacy and Cookies Policy-da for the Danish translation.
  • Privacy and Cookies Policy-fr for French translation. 
  • Privacy and Cookies Policy-de for the German translation.

That is, instead of the Privacy and Cookies Policy text, its translated text will be displayed in the GDPR cookie consent plugin.

Once done, tick the Translation is complete checkbox. And then click on the Save button.

Now, switch the language option on your website to see the changes. On switching the language to Danish, you can see that the Privacy and Cookie Policy widget will be as shown below:

Privacy and Cookie Policy in Danish

However, to translate the content of the privacy overview, you will have to select  admin_texts_cookielawinfo_privacy_overview_ content_settings domain from the Select strings within domain drop-down. The screen will be as shown below:

Case 2: For labels, validation messages, pop-up content

On selecting cookie_law_info domain from the Select strings within domain drop-down, the screen will be as shown below:

String translation

Let us see the translation steps for Cookie message – Text editor.

  • Click on the translations link, and enter the translation text in respective languages as shown below:
Cookie message-text editor translated

Note: As per the above screenshot, Danish (da), French (fr), and German (de) are the configured languages in WPML.

For example, 

  • Cookie message – Text editor (Danish)  for Danish translation.
  • Cookie message – Text editor (French) is for French translation
  • Cookie message – Text editor (German) is used for German translation.

This means that instead of the Cookie message—Text editor text, its translated text will be displayed in the GDPR cookie consent plugin.

Once done, tick the Translation is complete checkbox. Click on the Save button.

On switching the language to Danish, you can see that the Cookie message-text editor will be as shown below:

Cookie message-text editor translated

Note:

  1. Switch the profile language to the desired language for better results.
  2. If you can’t find the string for translation in the select string domain menu, you will probably have to scan the strings. To scan for the strings, go to WPML > Themes and plugin localization. From the screen, navigate to the section Strings in the plugins. Select the GDPR Cookie consent plugin from the list and click on the Scan selected plugins for strings button, as shown below.
WPML-Theme and Plugins localization

At the end of the scan, all the strings in the plugin will be auto-populated into the String Translation domain, from which you can make the necessary translations, as mentioned at the beginning of this article.

In the script blocker, select the category name in the default language after selecting “All languages” from the language flag in the WordPress admin bar. The category slug in other languages won’t affect script blocking.

Translating cookies

  • Go to GDPR Cookie Consent > Cookie List
  • Click on Edit.edit-cookie
  • Add translate under Translate this document. translate-this-document-tab-in-gdpr
  • The Advanced Translation Editor window will appear.
  • Add translations for each title, body contents and save to complete.
  • The percentage of translation done can also be viewed at the bottom.advanced-translator-in-cookie-list
  • Click on Complete to finish.
  • Go to GDPR Cookie Consent > Cookie Category
  • Click on Edit.edit-cookie-category
  • Add translate under Language.languages-section-in-cookie-category
  • Click on Update.

Alternate method

Now, let us go through an additional method for translating cookie categories:

  • Navigate through WPML> Taxonomy Translation> Cookie Category Translation.
  • Click on Add icon to add the translations.Translation of Cookie Category
  • Click on Save to finish.

Switch the language option on your website to see cookies and category content in German.

Cookies and Cookie category listed in German


In a similar manner, you can translate the plugin contents to other desired languages.

Refer to know how the cookie plugin is translated using Polylang.