lundi 25 mai 2020

Notranslate for some languages

I have a website which I manually translated in five languages, adding the button to choose the preferred one.

My problem is that sometimes Google offers a Translate this page option for the user's language or, depending on the settings, automatically translates it.

And since $_SERVER['HTTP_ACCEPT_LANGUAGE'] is not always 100% reliable (if not missing at all), it could happen that an user (let's say an Italian user) who opens my website in the English version, finds a non-so-accurate-google-translated page instead of the "official" italian version of the website.

Furthermore, an user with an Italian HTTP_ACCEPT_LANGUAGE could want to see the website in another language for any reason, and it's quite annoying seeing Google's popup every time you change page (even if you can Disable it for this website).

So I found these solutions: <html lang="en" translate="no"> (which does not work for some reason) and <meta name="google" content="notranslate"> (which works).

The problem is that they prevent Google from translating in ANY language, comprehending the ones not included inside my website.

So, is there a way to prevent Google (or other translators) from proposing the translation of/automatically translate my page only in some languages?




Aucun commentaire:

Enregistrer un commentaire