Back to Community

How to Translate Your CookieYes Banner: Fixing Common Multilingual Issues

Content

Translating the CookieYes (GDPR Cookie Consent) banner for a multilingual WordPress site is a common challenge. Users frequently encounter issues where specific text strings don't appear for translation, the banner doesn't switch languages, or translations don't display correctly on the front end. This guide compiles the most effective solutions based on community support threads.

Why Do These Translation Issues Happen?

The problems often stem from a few key areas:

  • Plugin Version: The newer "revamped" version of CookieYes handles translations differently than the older "legacy" version. Confusing the two is a common source of problems.
  • Translation Method: Some text must be translated via the WordPress.org translation project, while other custom text is handled by multilingual plugins like WPML or Polylang.
  • Web App Connection: For certain languages (like Arabic), a connection to the CookieYes web app is required for translations to become available.
  • String Context: With plugins like WPML, you must select the correct string context (e.g., admin_texts_CookieLawInfo) to find all the translatable text.

Common Problems and Their Solutions

1. Can't Find Strings in WPML or Polylang

Problem: You've scanned for strings, but critical text like your custom cookie category descriptions or the banner message is missing.

Solution: Ensure you are looking in the correct string translation context. For WPML, navigate to WPML → String Translation and ensure the context is set to admin_texts_CookieLawInfo or a similar administrative context, not just the plugin's slug (cookie-law-info). For Polylang, check the strings under Languages → String translations.

2. "Show more," "Show less," "Save & Accept" Buttons Won't Translate

Problem: These common button labels remain in English even after using a translation plugin like Loco Translate.

Solution: These "static" strings are not translated through your multilingual plugin. They are loaded directly from the official WordPress translation repository. You must:

  1. Visit the CookieYes translation project page.
  2. Select your language and add the missing translations for these strings.
  3. Wait for a translation moderator to approve them. Once approved, they will be automatically delivered to your site via WordPress updates.

3. Banner Doesn't Switch Language with Page Language

Problem: You switch the page language using your multilingual plugin, but the cookie banner language stays the same.

Solution: This behavior is often tied to the lang attribute in your site's HTML.

  • If you are not connected to the CookieYes web app, ensure your multilingual plugin is correctly translating the strings as described in solution #1.
  • If you are connected to the web app, the banner language is determined by your site's lang attribute. A workaround is to manually set this attribute using a script. For example, you can conditionally set it for Italian:
    <script>
    if (conditionToShowItalian) {
      window.ckySettings = { documentLang: "it" };
    }
    </script>

4. Specific Languages (e.g., Arabic) Are Not Available

Problem: You cannot select or see a translation for a specific language in the plugin's language tab.

Solution: For some languages, you must connect your plugin to a free CookieYes web app account. Once connected, navigate to the Language tab within the web app dashboard to add and manage additional languages.

5. Privacy Policy Link Points to Default Language Only

Problem: The "Read More" link in the banner always goes to the privacy policy page in the site's default language, even when viewing the site in a secondary language.

Solution: The current version of the plugin does not automatically detect a different privacy policy page for each language when a page is selected. The recommended workaround is to:

  1. In the plugin settings, under Customise Buttons → Read More, choose URL instead of Page.
  2. Manually enter the full URL for each language's privacy policy page (e.g., https://your-site.com/en/privacy-policy/ and https://your-site.com/es/politica-de-privacidad/). Your multilingual plugin will then handle the correct link based on the active language.

Key Takeaways

  • Identify Your Version: Know if you are using the legacy plugin or the newer revamped version connected to the web app, as their translation methods differ.
  • Use the Right Tool: Use WPML/String Translation for custom text you entered, but use the official translate.wordpress.org site for the plugin's default button labels and common phrases.
  • Check the Context: When strings are missing in your translation plugin, double-check that you are searching within the correct translation context.

By following these steps, you should be able to resolve the majority of translation issues and ensure your cookie consent banner is fully compliant and user-friendly in all your site's languages.

Related Support Threads Support