Issue with translations on website

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

2 Likes

Hi there and welcome to the Community, @Mister_Sonder :waving_hand:

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 :slightly_smiling_face:

1 Like

Words bad traducted: Relojes in spanish, Clocks in english. The right would be Watches

2 Likes

Words dont traslated: Collar, Correa in section filter, inside the catalag products Tienda – Mr. Sonder

2 Likes

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 :slightly_smiling_face:

As for the words Collar, Correa, they get translated now:


Could you please double-check it?

1 Like

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

1 Like

Hi there, @Mister_Sonder :waving_hand:

I’ve forwarded the issue with the exclusion of brands from translation to the devs. I’ll report back once any news comes up :slightly_smiling_face:

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 :slightly_smiling_face: