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 1 reply, has 2 voices.

Last updated by Marcos Vinicios Barreto 5 months ago.

Assigned support staff: Marcos Vinicios Barreto.

Author Posts
May 16, 2019 at 7:23 pm #3829205

kimF

I am trying to add a 'catchphrase' to the header of this website. I've added the following code within the <head> tag

<script>

jQuery(document).ready(function (){
jQuery("<div class='catchphrase' style=\"display: inline-block; font-size: 14px;\">Une initiative du réseau pour la paix et l'harmonie sociale</div>").appendTo(".logo_container");
});
</script>

However, I am unsure how to adjust this code to display the english catchphrase on the English version of the website. Any suggestions for what I should be doing differently?

Thanks in advance!

May 17, 2019 at 12:09 am #3829885

Marcos Vinicios Barreto
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Bahia (GMT-03:00)

Hello,

Thank you for contacting WPML Support. In order to make any string ready for translation in JavaScript files you need to make sure this string is passed to the script using the 'wp_localize_script' function as you can read at: https://codex.wordpress.org/Function_Reference/wp_localize_script as WPML is not able to scan JS files for string translations. Please, let me know if it helps, have a nice day.