Hi,
Could you give the link of your plugin.
Well…
My plugin is Polylang for the management of languages.
Then, Aweber has a platform on their site to create the piece of script for the Sign In forms, and they provide automatically those scripts to be inserted within the body tags of the site.
For instance, I got for french version:
<div class=”AW-Form-1839868564″></div>
<script type=”text/javascript”>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//forms.aweber.com/form/64/1839868564.js”;
fjs.parentNode.insertBefore(js, fjs);
}(document, “script”, “aweber-wjs-q8szyb1dh”));
</script>
and for the english version:
<div class=”AW-Form-1611189339″></div>
<script type=”text/javascript”>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = “//forms.aweber.com/form/39/1611189339.js”;
fjs.parentNode.insertBefore(js, fjs);
}(document, “script”, “aweber-wjs-nrq65vut6”));
</script>
What I’m trying to do is to display one or another depending on the detection done by polylang of the language of the page…
Or another possibility would be a script trick using the parameters of language of Polylang (fr_FR, en_GB, etc) looking like so:
<script>
if lang=fr_FR then run script_fr
else run script_en
</script>
Do you see a solution that can solve this problem ? 🙂
For you to see them working, I’ve installed both script in the body part of my site:
corposano.com
I’ve inserted them at the end of the header.php via the Appearance/Editor tool of the WP admin.
Is it freely available? If yes you could you give a link.