Hi,
I’m using the Custom Pop-up Window Content option.
I tried editing theme from the English language and I reviewed your documentation https://kriesi.at/documentation/enfold/privacy-cookies/
without success.
How can I adapt the messages according to the chosen language, please?
Thank you for your attention.
Best regards
Rolland
Hey RollandH,
Thank you for the inquiry.
Unfortunately, it’s not possible to translate the content of the cookie or privacy options using Loco Translate. As a solution, we added this code to the functions.php file.
function av_lang_cb( $atts, $content = null ) {
$atts = shortcode_atts(
array(
'only' => '',
),
$atts
);
$current_locale = get_locale();
if ( strtolower( $current_locale ) === strtolower( $atts['only'] ) ) {
return do_shortcode( $content );
}
return '';
}
add_shortcode( 'av_lang', 'av_lang_cb' );
You can now use these shortcodes to control the visibility of content in different languages.
[av_lang only="en_US"]
This text is visible only on English pages.
[/av_lang]
[av_lang only="fr_FR"]
Ce texte n'est visible que sur les pages en francais.
[/av_lang]
Best regards,
Ismael
Hey Ismael,
Thank you for your response.
I understand the situation and the approach. I’m very busy with other projects today, but I’ll get back to you tomorrow if necessary.
Have a good day.
Best regards,
Rolland
