Discount Sale
  • Days
  • Hrs
  • Mins
  • Secs
30% Off

Use coupon code 'MDS30' Limited Offer!!

Star

Home > Docs > GDPR Cookie Consent(Legacy Version) > Translating Cookie and Cookie Category using WPML

Translating Cookie and Cookie Category using WPML

Last updated on April 3, 2025

Translating cookie consent notices, banners, and categories becomes even more critical when managing a multilingual WordPress site. By combining WPML’s powerful translation capabilities with GDPR Cookie Consent’s compliance tools, businesses can provide a consistent and legally compliant experience for users in different regions. This article explores why multilingual cookie consent is essential, how WPML and GDPR Cookie Consent work together, and the step-by-step process to implement to translate cookie banners, consent messages, and cookie categories into multiple languages, ensuring compliance and improving user trust across global audiences.

Prerequisites

Make sure you have:

  • Installed and activated the GDPR Cookie Consent Plugin.
  • Installed and configured the WPML core plugin.
  • Activated the WPML String Translation add-on.

The Article flows as follows:

  1. Translating the plugin content.
    1. Static content
    2. Dynamic content
  2. Translating cookies
  3. Translating cookie categories

Translating Plugin Content

Step 1: Scan the Plugin for Strings

Before starting the translation process, scan the plugin to identify translatable strings.

  1. Navigate to WPML > Theme and Plugins Localization in your WordPress dashboard.
  2. Scroll to the Scan strings in themes, plugins, and WordPress section.
Select plugin for scanning - WPML
Select plugin for scanning – WPML
  1. Under the Plugins section, locate and select GDPR Cookie Consent plugin.
  2. Click Scan selected components for strings to start scanning.
  3. Wait for WPML to complete the scanning process. A pop-up will display the total number of detected strings.
  4. Once the scan is complete, WPML will add the identified strings to the translations table.

Step 2: Selecting and translating the static strings.

Hardcoded text in your plugin is called static content. It is hardcoded in PHP files and includes UI elements like buttons, labels, messages, and form field placeholders. These texts do not change based on user input.

  1. Navigate to WPML > Translation Management.
  2. Scroll down until you find the Other Texts (Strings) section, which allows you to translate text from themes, plugins, and additional elements.
  3. Click on the All domains filter and select the relevant domain. The static content of the WebToffee’s Cookie Consent Plugin is listed in the textdomain: webtoffee-gdpr-cookie-consent.
Translating static string - WPML
Translating static string – WPML
  1. Use the search bar to find specific text you want to translate.
  2. Check the boxes next to the strings that require translation.
  3. After selecting the required strings, scroll to the Translate your content section.
  4. WPML will take you to the Translation Controls interface, where you can configure how the plugin should translate the selected strings.
  5. Click on the dropdown menu next to All languages to select the translation method:
    • Translate automatically – WPML AI instantly translates the content.
    • Translate manually – Users manually input translations.
    • Do nothing – This is used for custom languages, which the AI won’t be able to translate. The translation has to be input manually.
Translating to custom language - WPML
Translating to custom language – WPML
  1. WPML offers review options before publishing translations. Select the preferred review type.
  2. If WPML detects previously translated content, choose whether to keep existing translations or overwrite them.
  3. Once everything is configured, click the Translate button to finalize the translation process.

Step 3: Selecting and translating the dynamic strings.

Dynamic content is stored in the WordPress database and changes based on user input, plugin settings, or site configuration.

  1. Navigate to WPML > Translation Management.
  2. Scroll down until you find the Other Texts (Strings) section, which allows you to translate text from themes, plugins, and additional elements.
  3. Click on the All domains filter and select the relevant domain. The dynamic content of the WebToffee’s Cookie Consent Plugin is listed when admin_text_cookielawinfo-0.9 is selected.
Translating dynamic string - WPML
Translating dynamic string – WPML
  1. Use the search bar to find the specific text you want to translate.
  2. Check the boxes next to the strings that require translation.
  3. After selecting the required strings, scroll to the Translate your content section.
  4. WPML will take you to the Translation Controls interface, where you can configure how the plugin should translate the selected strings.
  5. Click on the dropdown menu next to All languages to select the translation method:
    • Translate automatically – WPML AI instantly translates the content.
    • Translate manually – Users manually input translations.
  6. WPML offers review options before publishing translations. Select the preferred review type.
  7. If WPML detects previously translated content, choose whether to keep existing translations or overwrite them.
  8. Once everything is configured, click the Translate button to finalize the translation process.

Translating Cookies

The Cookies can be translated from the Cookie list page. To translate the Cookies into the preferred language, follow the steps mentioned below:

  1. Go to GDPR Cookie Consent > Cookie List
  2. Click on Edit.
Translating cookies
Translating cookies
  1. Add translate under Translate this document.
Adding translation - Cookie content
Adding translation – Cookie content
  1. The Advanced Translation Editor window will appear.
  2. Add translations for each title, body contents, and save to complete.
  3. The percentage of translation done can also be viewed at the bottom.
Advanced translation editor - WPML
Advanced translation editor – WPML
  1. Click on Complete to finish.

The cookie category can be translated using two different methods:

  • From the Cookies Category page in the GDPR Cookie Consent plugin.
  • From the Taxonomy Translation page in the WPML plugin.
  • Go to GDPR Cookie Consent > Cookie Category
  • Click on Edit.
  • Add translate under Language. This will open up a new Add Cookie Category page. As translations are added as new categories, enter the translated text and click on the Add cookie category. You can see additional information, such as Language, and This is a translation of. This extra information lets us know the original cookie category to which the translated one belongs.

Method 2: From the Taxonomy Translation page in the WPML plugin.

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.