- September 20, 2023
The CookieYes plugin adds a subtle banner about cookie law compliance to your website, either in the header or footer. Use WPML to easily translate the content of this message.
Message in original language
Message translated to German
On This Page:
- Getting Started
- Making Your Content Translatable Using WPML
- Translating Your Cookies Message Bar & Buttons
- How to Block Cookies Before Consent
- Known Issues
- Getting Help From Our Support
Start by installing and activating the following:
- The CookieYes plugin
- WPML core plugin and WPML String Translation add-on
If you’re new to WPML, check out our Getting Started Guide. It quickly walks you through all the translation options you can use.
Go to the WPML → Theme and plugins localization page, scroll down to the Strings in the plugins section and select GDPR Cookie Consent from the list. Finally, click on the Scan selected plugins for strings button.
Once you’ve set your consent message on the GDPR Cookie Consent → Settings page, you will need to translate it. We will translate the main Cookie Message and the Accept All button as shown below:
- Go to the WPML → String Translation page.
- Use the filter on the top of the page to find the text you want to translate.
- When you find the relevant string, click on the plus symbol under the corresponding language you want to translate first. A dialogue box will open where you can add the translation. Once you’ve completed the translation, simply click on the tabbed arrow for the next language to save and move on. If there are no more translations to add, click outside of the dialogue box or press return on your keyboard to save the content and exit the box.
- Follow the same steps to translate the main Cookie Consent message:
If you choose to display a Read More button, the user needs to be redirected to a landing page via a link in the correct language.
- Go to the GDPR Cookie Consent → Settings page, click the Customise Buttons tab, and then the Read more sub-tab. Set the URL in the default language. In our example, our Read More button links to “https://mylink.co.uk”.
- Now, go back to the WPML → String Translation page and search for this button’s string.
- Click the plus symbol and translate the text just like any other string.
- Repeat these steps for translating the link’s URL, remembering to add the necessary language extension, eg, “de” for German.
Using CookieYes, you can easily block cookies until a user gives consent.
For example, let’s say you are using WPML’s Browser language redirect feature. To redirect users to their preferred language, this feature enables the
_icl_visitor_lang_js cookie for all site visitors.
You can ensure this cookie is set only after a user clicks the Accept button:
- From your site’s dashboard, go to CookieYes and click on the Go to Web App button.
- From your CookieYes dashboard, enter the Cookie Manager tab and scan your site for cookies.
- Once scanning is complete, click on the Functional tab and edit the _icl_visitor_lang_js cookie.
- Expand the Show advanced options section. In Script URL Pattern, enter sitepress-multilingual-cms and Submit your changes.
In case you need help translating your site built using CookieYes and WPML, visit WPML’s support forum.