Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
how to translate the cookie and gdpr consent policy:
https://wordpress.org/plugins/cookies-and-content-security-policy/

Solution:
1) Add next code to WPML > Settings > Custom XML configuration:

<wpml-config>
    <admin-texts>
        <key name="cacsp_option_text_header"/>
        <key name="cacsp_option_text_info"/>
        <key name="cacsp_option_text_link_text"/>
        <key name="cacsp_option_text_settings"/>
        <key name="cacsp_option_text_always_allow_header"/>
        <key name="cacsp_option_text_always_allow_description"/>
        <key name="cacsp_option_text_statistics_header"/>
        <key name="cacsp_option_text_statistics_description"/>
        <key name="cacsp_option_text_experience_header"/>
        <key name="cacsp_option_text_experience_description"/>
        <key name="cacsp_option_text_marketing_header"/>
        <key name="cacsp_option_text_marketing_description"/>
        <key name="cacsp_option_settings_button"/>
        <key name="cacsp_option_accept_all_button"/>
        <key name="cacsp_option_save_button"/>
        <key name="cacsp_review_settings_description"/>
        <key name="cacsp_review_settings_button"/>
        <key name="cacsp_not_allowed_description"/>
        <key name="cacsp_not_allowed_button"/>
    </admin-texts>
</wpml-config>

2) Add default language text in Cookies and Content Security Policy > Texts and Save

3) Go to WPML > String Translation find the Cookie text and translate. Make sure to mark Translation is complete.

Relevant Documentation:
- https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Dražen Duvnjak 1 year, 11 months ago.

Assigned support staff: Dražen Duvnjak.

Author Posts
July 23, 2020 at 11:37 am #6660865

pernillaA

I hope you can explain to me how to translate the cookie and gdpr consent policy:
https://wordpress.org/plugins/cookies-and-content-security-policy/

Page link where issue can be seen:
hidden link

July 23, 2020 at 2:29 pm #6663055

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

in the meantime, I checked your issue and plugin you mentioned on a clean sandbox page.

First, let me say I don't see this plugin in our official compatible plugins list. This doesn't mean it won't work with WPML, but some issues can happen or it might not work correctly since it is not officially WPML compatible.

List: https://wpml.org/plugin/

Please invite the author to our compatibility program: https://wpml.org/documentation/theme-compatibility/go-global-program/

-

Nevertheless, I have managed to translate this plugin admin text and show correct translation following our documentation:

- https://wpml.org/documentation/support/language-configuration-files/#admin-texts
- https://wpml.org/documentation/getting-started-guide/translating-theme-options/

1) Please add next code to WPML > Settings > Custom XML configuration:

<wpml-config>
    <admin-texts>
        <key name="cacsp_option_text_header"/>
        <key name="cacsp_option_text_info"/>
        <key name="cacsp_option_text_link_text"/>
        <key name="cacsp_option_text_settings"/>
        <key name="cacsp_option_text_always_allow_header"/>
        <key name="cacsp_option_text_always_allow_description"/>
        <key name="cacsp_option_text_statistics_header"/>
        <key name="cacsp_option_text_statistics_description"/>
        <key name="cacsp_option_text_experience_header"/>
        <key name="cacsp_option_text_experience_description"/>
        <key name="cacsp_option_text_marketing_header"/>
        <key name="cacsp_option_text_marketing_description"/>
        <key name="cacsp_option_settings_button"/>
        <key name="cacsp_option_accept_all_button"/>
        <key name="cacsp_option_save_button"/>
        <key name="cacsp_review_settings_description"/>
        <key name="cacsp_review_settings_button"/>
        <key name="cacsp_not_allowed_description"/>
        <key name="cacsp_not_allowed_button"/>
    </admin-texts>
</wpml-config>

2) Add default language text in Cookies and Content Security Policy > Texts and Save

3) Go to WPML > String Transaltion find the Cookie text and translate. Make sure to mark Translation is complete.

Let me know how it goes and if you still need my help.

Thank and regards,
Drazen

Screenshot_3.jpg
July 23, 2020 at 4:36 pm #6664081

pernillaA

Thank you very much Drazen.
I wonder about the translation. I completed point 1. In point 2, I translated the german to englilsh. But now I see that the english version is defalut when entering the website. It is meant to show english only after choosing english.

I enclose a screen shot.

So, how does the visitor change to english when entering the website? (the flags are in the menu and the menu is only visible after clicking ok to the cookie message).

Thank you!

Skärmavbild 2020-07-23 kl. 18.37.49.png
July 24, 2020 at 6:52 am #6667721

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

so you have translated as instructed and it is working fine this part? Make sure you translated and set correctly, in WPML> String translation, correct flag show next to text. So for default German, next to it should be German flag.

So, how does the visitor change to english when entering the website?(the flags are in the menu and the menu is only visible after clicking ok to the cookie message).

I see this as the only way since this how the plugin functions. When you visit the German page it shows popup the german text, and when you visit the English page you see English text popup. I can suggest using a different Cookie plugin (compatible list) that will be more suitable for you.

Other than that I can suggest:

- enable browser redirect, so the user is redirected to correct language when visiting the page > https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/

- add language switcher (flags) to Cookie plugin via our shortcodes
> https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/#using-wpml-shortcodes

Please let me know how it goes and don't hesitate to ask if you find any problem along the way or have doubts or questions about the steps mentioned above, I'll do my best to help you in the best way possible.

Regards,
Drazen