-
AuthorPosts
-
February 28, 2019 at 3:47 pm #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,
KarinaMarch 2, 2019 at 7:07 pm #1073686Hey 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,
VictoriaMarch 4, 2019 at 11:32 am #1074290Hi 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 pageBest,
KarinaMarch 4, 2019 at 12:36 pm #1074324well 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]
March 5, 2019 at 8:35 am #1074711March 10, 2019 at 1:41 am #1076870Hi 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
March 14, 2019 at 6:43 pm #1078783Hi,
You cant add just the shortcode on functions.php can you show us exactly how you did it?
Best regards,
BasilisMarch 14, 2019 at 7:08 pm #1078795Hi 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,
KarinaMarch 15, 2019 at 12:39 pm #1079095if 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.
March 15, 2019 at 6:18 pm #1079201Hi 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
March 16, 2019 at 8:05 am #1079378the way could be to enable nested shortcodes on wordpress.
The trick will be a do_shortcodeMaybe a mod could tell us to activate the nested shortcodes like in the whole enfold usage ;)
March 20, 2019 at 8:03 pm #1081003It would be nice if the whole theme would support polylang. :)
March 22, 2019 at 7:00 pm #1081976Hi,
Thank you for the feedback and the Suggestion – it is much appreciated!
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.