hi Max, a similar problem here at Wales Outdoors. The translator is translating place names which are relatively meaningless when translated literally. So, a Welsh place name on my site, say ‘Sgwd yr Eira’ is translated to ‘Snow Scud’ as the default is English. Is there any way to remove the English default whilst returning the site as it is set up and having the visitor click a translate button to see any translation?
Hi there, @Andy_Lamb
Could you please send me a link to the page where this issue occurs?
The titles have been translated and you can see the Welsh names of the waterfalls in the text, which remains untranslated
Thank you!
I’ve forwarded it to the devs and will update you once I have their response
Hi there, @Andy_Lamb
We’ve added this class (u_1098176504) to the Translation Exclusion and now everything is working fine:
Check it out and let me know how it works on your end
Thank you so much - works perfectly as far as I can see
Awesome, you’re very welcome
I checked it again and unfortunately, the fix isn’t working. In chromes incognito it works as it doesn’t default with ‘?lang=en-GB’ but in chrome it defaults with ?lang=en-GB and changes most Welsh language phrases and names into English. You can see this in the homepage where without ?lang=en-GB it displays Croes i Gymru but with it displays welcome to Wales. It’s not a big deal with that item but it changes names still as well, so hikes in North Wales it changes Penygader to ‘an Expression’…
This fix was applied to the names of the waterfalls only on this page. As you can see, the waterfall names aren’t translated there anymore.
The Translation Exclusions feature doesn’t automatically exclude all proper names on multiple pages. You should find the class for each name and exclude them separately.
I’ve checked your homepage and haven’t found the Penygader changing to an Expression phrase. Could you please show me where it’s placed?
If you’d like to exclude more names/texts on multiple pages, please list these phrases and specify the pages where I can find them
Thank you so much for getting back to me and this is a bit more complicated than I first thought. Thank you for explaining. As my website is growing in size and most pages use a variety of Welsh place names and some phrases if I give you the main pages to correct that would be amazing. It’s interesting that it doesn’t convert all place names and phrases, just some. Also, I am not a skilled developer so if you can tell me how to locate an ID I’m happy to then exclude those that I find on an ongoing basis.
Home Page, hike and tour pages - Croeso I Gymru is translated to Welcome to Wales
Within the elfsight map app on the home page a few of the place names, particularly waterfall names, are being mis translated and that is where you’ll find an expression instead of Penygader
Hi there, @Andy_Lamb
The thing is that not all elements on the page have its own class. For example, the names of the waterfalls on this page have classes. To find it, just right-click the needed element, choose Inspect, and you’ll see the class of the inspected waterfall name:
In this case, the class is u_1900443754 and we’ve added it to the Translation Exclusions in the widget’s settings.
The “Croeso I Gymru” phrase and location names don’t have their own class. The good thing is that our devs will create a script that will assign custom classes to the “Croeso I Gymru” phrase and location names to exclude them from translation.
I’ve forwarded your request to the devs and will let you know once the solution is ready
Thank you so much Max, you are amazing! I’m so impressed with the functionality of the apps and the customer support is second to none. Thank you.
Hi there, @Andy_Lamb
We’ve added this script to the Custom JS field on the Settings tab of your widget’s settings:
const TEXT_TO_EXCLUDE = 'Croeso i Gymru!';
const TEXT_TO_EXCLUDE_SELECTORS = {
'/': '[id="1072990619"] strong',
'/hikes': '[id="1814700442"] p:nth-child(2) strong',
'/tours': '[id="1914893746"] p:nth-child(2) strong',
};
const selector = TEXT_TO_EXCLUDE_SELECTORS[window.location.pathname];
if (!selector) return;
const elem = document.querySelector(selector);
if (elem) {
const textParts = elem.textContent.split(TEXT_TO_EXCLUDE);
elem.innerHTML = textParts.join(
`<span class="exclude-translation">${TEXT_TO_EXCLUDE}</span>`
);
}
And these classes were added to the Translation Exclusions:
Please check your website and let me know if everything is fine now
All good with me - thank you so much for helping me out, it really is much appreciated
Great, we’re always here to help if anything else comes up