Tagged: ,

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1072657

    Hi everyone,

    I am using the Enfold Theme on a bilingual website (German and English) and would love to have a cookie notice and all the other cool GDPR feature in German and English language. However, I haven’t figured out if there is a way to do this? Right now I am only able to display one language. Is there a code that can be used in order for enfold to switch between two messages?

    This would be helpful for all GDPR features including the nice buttons where user can switch off Google Analytics.

    Best,
    Karina

    #1073686

    Hey Karinabutterfly,

    Here is a thread for you to consider
    https://kriesi.at/support/topic/how-to-translate-cookie-consent-message/

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1074290

    Hi Victoria. Thanks for your response. However, that’s not really helping because I don’t only want to add an English text to the cookie notice, but I would like to use all the privacy features in two languages. For the cookie consent, I have a plug-in that shows two languages and works great. However, I would also like to use the checkbox with text for contact forms and comments, as well as all the shortcodes below in two languages.

    * [av_privacy_google_tracking] – Ermöglicht es einem Benutzer, Google Tracking in seinem Browser zu deaktivieren
    * [av_privacy_google_webfonts] – Ermöglicht es einem Benutzer, die Verwendung von Google Webfonts in seinem Browser zu deaktivieren
    * [av_privacy_google_maps] – Ermöglicht es einem Benutzer, die Verwendung von Google Maps in seinem Browser zu deaktivieren
    * [av_privacy_video_embeds] – Ermöglicht es einem Benutzer, Videoeinbettungen in seinem Browser zu deaktivieren
    * [av_privacy_link] – displays a link to the privacy policy page set in your WordPress admin panel or to a custom page

    Best,
    Karina

    #1074324

    well you can activate the shortcode function on polylang via child-theme functions.php

    function polylang_shortcode($atts, $content = null){
    	if (empty($content))
    	return '';
    	extract( shortcode_atts( array('lang' => ''), $atts ) );
    	if (empty($lang))
    	return "<h3>You must specify 'lang' using shortcode: polylang</h3>";
    	return ($lang == pll_current_language()) ? $content : '';
    }
    add_shortcode('polylang', 'polylang_shortcode');

    after activation you can use it like:
    [polylang lang="en"]English[/polylang][polylang lang="de"]Deutsch[/polylang]

    on WPML i got as many Enfold Options as i got languages – so that was a bit more confusing but easier to style.

    With Polylang you can now insert in the Cookie Consent Message input field the messages as mentioned above:
    f.e:

    [polylang lang="en"]This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.[/polylang][polylang lang="de"]Diese Webseite verwendet Cookies. Durch das weitere Verwenden der Webseite erklären Sie sich mit der Nutzung von Cookies einverstanden.[/polylang]

    #1074711

    Hi,

    Thanks for sharing and for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1076870

    Hi everyone,

    I changed the functions.php and tried this:

    [polylang lang=”en”][av_privacy_google_tracking]english[/av_privacy_google_tracking] [/polylang]
    [polylang lang=”de”][av_privacy_google_tracking] Deutsch[/av_privacy_google_tracking] [/polylang]

    but it’s obviously wrong and I don’t know why.

    Could you help me out one last time?

    Best,

    Karina

    #1078783

    Hi,

    You cant add just the shortcode on functions.php can you show us exactly how you did it?

    Best regards,
    Basilis

    #1078795

    Hi Basilis,

    I think this is a misunderstanding. I did of course not add a shortcode to the functions.php.

    As Guenni suggested I added this to the functions.php:

    function polylang_shortcode($atts, $content = null){
    if (empty($content))
    return ”;
    extract( shortcode_atts( array(‘lang’ => ”), $atts ) );
    if (empty($lang))
    return “<h3>You must specify ‘lang’ using shortcode: polylang</h3>”;
    return ($lang == pll_current_language()) ? $content : ”;
    }
    add_shortcode(‘polylang’, ‘polylang_shortcode’);

    Then I wanted to create the privacy policy with the on/off switches and used these shortcodes in the enfold privacy settings:

    [polylang lang=”en”][av_privacy_google_tracking]english[/av_privacy_google_tracking] [/polylang]
    [polylang lang=”de”][av_privacy_google_tracking] Deutsch[/av_privacy_google_tracking] [/polylang]

    But it did not work. I did not see a German or English version but an error message when activated.

    Best,
    Karina

    #1079095

    if you enter the mentioned above :
    [polylang lang="en"]This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.[/polylang][polylang lang="de"]Diese Webseite verwendet Cookies. Durch das weitere Verwenden der Webseite erklären Sie sich mit der Nutzung von Cookies einverstanden.[/polylang]
    that will work if you switch the languages it will only show you the concerning language?

    i do not know if nesting of shortcodes in this inputfield will work.

    What if you do it the other way round:
    [av_privacy_google_tracking][polylang lang="en"]The english context[/polylang][polylang lang="de"]Der deutsche Text[/polylang][/av_privacy_google_tracking]

    Something very elementary – if you like to have GDPR compliance.
    I think only tools that block till settings are made are compliant with GDPR.
    The Google Fonts are loaded ( and IPs are sent ) before you answer to those questions – so ? …

    i think only a tool like i use ( Borlabs Cookie) do the job in a good manner.

    #1079201

    Hi Guenni,

    thanks again for your reply.

    I know the code works for the cookie notice. However, I don’t really need it for the cookie notice since there are lots of plug-ins for the notice that already supported a language switch. I wanted to use all the GDPR feature including the on/off switches as described above and therefore the code doesn’t work.

    I also tried it the other way around and it did not work.

    Thanks!

    Karina

    #1079378

    the way could be to enable nested shortcodes on wordpress.
    The trick will be a do_shortcode

    Maybe a mod could tell us to activate the nested shortcodes like in the whole enfold usage ;)

    #1081003

    It would be nice if the whole theme would support polylang. :)

    #1081976

    Hi,

    Thank you for the feedback and the Suggestion – it is much appreciated!

    Best regards,
    Basilis

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.