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.
// 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
}
Indra Pinsel - Front-end developer - Bright Digital ✅ Did my answer solve your issue? Help the community by marking it as the solution.
Thanks for taking the time to loop back here, @Indra🙌
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.
Did you know that the Community is available in other languages? Join regional conversations by changing your language settings !
@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.
// 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
}
Indra Pinsel - Front-end developer - Bright Digital ✅ Did my answer solve your issue? Help the community by marking it as the solution.
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.
HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates. Learn More.