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:
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.
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:
To translate the string Privacy and Cookie Policy follow the below steps.
- Click on the translations link, enter the translation text in respective languages as shown below:
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:
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:
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:
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:
Note:
- Switch the profile language to the desired language for better results.
- 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.
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
To translate the contents in Cookie Settings pop-up, we need to translate each cookie individually.
- Go to GDPR Cookie Consent > Cookie List
- Click on Edit.
- Add translate under Translate this document.
- 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.
- Click on Complete to finish.
Translating cookie categories
- Go to GDPR Cookie Consent > Cookie Category
- Click on Edit.
- Add translate under Language.
- 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.
- Click on Save to finish.
Switch the language option on your website to see cookies and category content 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.
Pietro
March 23, 2022
Hello,
I installed the plugin on the gelson.it site
In the Italian version, the plugin works and on the popup it shows me and select the cookies I want to activate / deactivate but if I switch to the English language the popup opens correctly but I do not see the list of cookies inside it.
Suggestions? A thousand thanks
Mark
March 24, 2022
Hi Pietro,
Please follow the instructions in the article and translate the categories and cookies to the English language too.
Eduard Kasdorf
January 10, 2022
Hey there,
the standard language for GDPR Cookie Consent ist englisch.
How can I change that to german?
I Use WPML and have two languages: german and “easy german” (for weak readers).
My website is:
www.lebenshilfe-stuttgart.de
Mark
January 10, 2022
Hi Eduard,
We are here to assist.
The language for all the static elements in UI can be translated automatically to German just by choosing your default language as German on your site. Other dynamic or user input strings like cookie consent bar message, cookie description, etc won’t be translated automatically. You need to manually edit them using WPML following the above guide.
Kali
November 30, 2021
Hello,
I have an issue with cookie bar not hiding on translations of Cookie Policy page.
I’m using WPML plugin on my website, the default language is english. In GDPR Cookie Consent settings under “Customise buttons” -> “Read more” I have selected a page which contains the content of my Cookie Policy, then I opted for hiding the cookie bar in this page so that it can still be accessed and read before any settings are confirmed. Through WPML, I also added polish and german translations for the same page.
Everything works as intended if I access the default page for my Cookie Policy, which is in english. However, when I view polish or german translation of the Policy (before I accept or reject any cookies), the bar is still present. This in effect blocks me from reading it, since I have also selected the popup with overlay option for my cookie bar.
Due to how my website and its theme works, I cannot resort to simple string translation outlined in the article above.
Would you mind suggesting another solution to this issue?
– Kali
Mark
December 6, 2021
Hi Kali,
We are here to assist.
You can use this filter to hide the banner on any using the page slug. Please read the article and after replacing the page slugs with your privacy policy page slug in the code, copy the code to your active child theme’s functions.php.
Klemart3D
July 2, 2021
Hi, how can I translate a meta like “header script” to display a different script/tag for each language? I do it for two languages FR + EN, the script FR is well displayed but not the EN script 🙁
Mark
July 5, 2021
Hi,
Kindly submit a ticket here with the different scripts and mention the version number of the plugin you are using.
Germán
May 4, 2021
Hello
I am using this shortcode
[cookie_audit_category columns="cookie,description,duration,type,category" style="winter"]
in the Spanish page the table is shown, but in the English page it does not, it only shows the header of the table.
What can i do?
Mark
May 6, 2021
Hi,
Kindly ensure that you have translated categories and cookies to English language as well. You must assign the translated cookies to translated categories.
Alberto
April 27, 2021
I have installed wpml (ita,eng,fra) if I accept cookie in one language and I switch in other language showme another time the banner.
Why?
Mark
May 2, 2021
Hi Alberto,
We can help with that. Please submit and ticket here with your site URLs.
Peter jamieson
April 16, 2021
I need to translate the Privacy and Cookie Policy. However, under “admin_text_CookieLawInfo-0.9”, I do NOT have any section about the privacy policy where your screenshot shows I should add -de or the language suffix.
Why is this not visible to me ?
Mark
April 22, 2021
Hi Peter,
We added -de as a sample to understand that you can add your German or other translations there. Please add your actual translation instead.
Moisés Álvarez
April 9, 2021
I am having trouble with the translation of the Privacy Overview with WPML. I can’t find admin_texts_cookielawinfo_privacy_overview_content_settings and cookie_law_info in Select strings with domain drop down.
Mark
April 13, 2021
Hi Moisés,
We can help with that. Go to GDPR Cookie Consent > Privacy Overview menu and Save the settings once and then, revisit the String translation page.
Greg
March 27, 2021
Hi,
Can’t seem to find where to translate, bI’m using WPML, the cookie duration (months, day, years).
Also, where to set if toggle are ON or OFF in the cookie settings (e.g. Neccesary cookies).
Thank you.
Mark
April 1, 2021
Hi Greg,
Those strings are translated within the plugins translation files. If you are working with a language not supported currently, please submit a ticket here with your requirement.
To set the button state, please go to Cookie Category > click Edit on the category that you want to change and find default button state there.
Edmunds
February 9, 2021
Hello. I scanned plugin and theme again, but in string translation doesnt have this domain, so i can’t translate privacy overview text – admin_texts_cookielawinfo_privacy_overview_ content_settings.. What should i do?
Mark
February 15, 2021
Hi Edmunds,
We are here to assist.
The domain should be present in the list. In order to debug the issue, please submit a ticket here with site details.
Agnes
December 4, 2020
I am having trouble with the Privacy Overview text.
I am editing it in French in the BO (as everything else in my site) and would expect to translate it with WPML string translator. But it does not appear.
I fount out I have to edit it in English in the BO, and then translate it opposite in French in Strings.
But when I come later, it is in French in the BO again, my edits do not reflect, and I have to redo it all: edit in English, translate in French.
I wonder if something is not wrong in that setup.
Rest works fine.
Agnes
December 4, 2020
I am having trouble with the Privacy Overview text.
I am editing it in French in the BO (as everything else in my site) and would expect to translate it with WPML string translator. But it does not appear.
I fount out I have to edit it in English in the BO, and then translate it opposite in French in Strings.
But when I come later, it is in French in the BO again, my edits do not reflect, and I have to redo it all: edit in English, translate in French.
I wonder if somethign is not woring in that setup.
Rest works fine.
Roy Keultjes
November 19, 2020
Hello, I can’t figure out how to translate the text in the pop-up that’s displayed above the Cookie Categories..?
Mark
November 20, 2020
Hi Roy,
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.
Morten Pauch
February 13, 2021
Where can I translate this “Privacy Overview” when using loco translate?
Morten Pauch
February 13, 2021
Nevermind – just found it 🙂
Ana Alonso
October 28, 2020
Hi,
I can’t find the way to translate the ‘disabled’ that is on the cookie configuration settings. In spanish it says Discapacitado which means disabled in a physical way but not in a metaphorical, which is quite horrible 🙁
where can I change it? I have looked at the WMPL strings, configuration, everywhere but I havent managed to find it.
Thanks in advance
Ana
Mark
November 3, 2020
The error in this translation is already fixed in the dev version. It will be updated in the next release.
Fabrice Piccinali
October 1, 2020
Hello,
I followed your instructions regarding to the categories translations. However, WordPress don’t let me copy/paste the same category slug for each language. For example, “necessary” becomes “necessary-en” in English language.
The primary language is French on this website.
Is it a known issue? What am I doing wrong?
Thanks for your help.
Best regards.
Mark
October 7, 2020
Please follow the instruction carefully. switch language from the top bar and use the quick edit link to do it.
Nicolas Mollet
July 24, 2020
Hello
I use the multilingual alternative plugin “Polylang”, is it compatible with GDPR Cookie Consent for string translations ?
Thank you
Mark
July 30, 2020
Please refer this article.
Justyna Ritter
May 26, 2020
It doesn´t work. I use GDPR with WPML. If I change the language from german to english – I get on the link privacy policy a 404 Error Site. The Link of my english Privacy Policy is not the same, like the standard Link from GDPR (Standard: /Privacy%20Policy — my translated Link: /privacy-policy/?lang=en
What can I do???
Mark
May 29, 2020
You can use the code snippet here to set the privacy overview page according to language.
Albertazzi Marta
May 13, 2020
Hello.
I need to provide the translation for the categories tags.
Where am I supposed to insert the translation for each cookie category? I searched into the WPML string locator/translator but could not detect them. Should I translate them directly in the plugin settings?
Thank you.
Mark
May 14, 2020
You can add the translation from the Cookie Category page itself. Use the (+) icon again the language flags.