Hi Max, We hace installed the widget website translate but there are some words dont translated and other words are bad translated, How can we update or fix it?
The website is mrsonder.com
Hi there and welcome to the Community, @Mister_Sonder
Could you please share an example of the poorly translated words and words that haven’t been translated? I’ll gladly look into this for you
Words bad traducted: Relojes in spanish, Clocks in english. The right would be Watches
Words dont traslated: Collar, Correa in section filter, inside the catalag products Tienda – Mr. Sonder
Thank you so much!
The thing is that our widget uses translated versions by Google. Thus, the translations you see are provided by Google (such as clocks instead of watches) and, unfortunately, there is nothing can be done with it at the moment.
However, we understand that the quality of the translation might need some improvement, and we do have plans to consider this idea in the future. Feel free to vote upvote it here
As for the words Collar, Correa, they get translated now:
Could you please double-check it?
Is possible the dont translated a one specific section ? We dont translated th filter Brands
And if the main language is possible that dont translated nothing in spanish and run the origin text
Hi there, @Mister_Sonder
I’ve forwarded the issue with the exclusion of brands from translation to the devs. I’ll report back once any news comes up
As for the main language, I see that the original website language is Spanish. When choosing the Spanish language in the widget, it doesn’t translate the original text additionally.
If I misunderstood your case, please describe it in more detail. I’ll gladly look into this for you!
We’ve excluded brand filter options from the translation using this code in the Custom JS field on the Settings tab of your widget’s settings:
const waitForElements = (selector, root = document) =>
new Promise((resolve) => {
const el = root.querySelectorAll(selector);
if (el.length) return resolve(el);
const observer = new MutationObserver(() => {
const el = root.querySelectorAll(selector);
if (el.length) {
resolve(el);
observer.disconnect();
}
});
observer.observe(root, { childList: true, subtree: true });
});
function replaceDivWithP(elements) {
elements.forEach((div) => {
if (div.tagName.toLowerCase() === 'p') return;
const p = document.createElement('p');
p.className = div.className;
if (!p.classList.contains('translate-exclusions')) {
p.classList.add('translate-exclusions');
}
p.innerHTML = div.innerHTML;
for (const attr of div.attributes) {
if (attr.name !== 'class') {
p.setAttribute(attr.name, attr.value);
}
}
div.replaceWith(p);
});
}
waitForElements('#wcf-pop-container-marcas .wcf-label-item').then(
(elements) => {
console.log(elements);
replaceDivWithP(elements);
const container = document.querySelector('#wcf-pop-container-marcas');
if (!container) return;
const observer = new MutationObserver(() => {
const updatedElements = container.querySelectorAll('div.wcf-label-item');
replaceDivWithP(updatedElements);
});
observer.observe(container, { childList: true, subtree: true });
}
);
Please check your website and let me know how it works