I am building a website in WordPress (with Elementor) and I would like to integrate a multilingual Contact form from Hubspot based on the language that the visitor will choose.
I tried different things but I was not able to solve this and the English form is the one appearing all the time.
I believe I need a conditional code to say something like : If the visitor chooses EN and is using [if lte IE 8], use this form OR if the visitor choses FR, then use that code.
Hello, First of all, thank you for taking the time to answer.
Now, to answer the question, I think I have none of this. I am basically using WeGlot to translate our website and I can only enbed the code through elementor.
So when I am on the websote in French and I want to paste the html code to the French form, it brings me to the English website every time which is not mirrored.
// Get page language
var lang = document.documentElement.lang;
// Get output for demo usage
var el = document.querySelector('.output');
// Set output
el.innerHTML = lang;
// Debug info
console.log('Page language' + lang);
// If conditions
if(lang == 'fr'){
// Your French code
} else {
// fallback or default
}
@dennisedson , @Indra , @Anton I have exactly the same problem on our website. Could you help us out? As we use weglot for translating the whole website, but just the Hubspot form is not translated. I would very highly appreciate help in this regard.