Domanda

I want my users to be able to use Chrome's built in translator, but I don't want it to translate certain values such as usernames, email addresses, filenames, other nouns, etc.

Is there an attribute I can stick on elements that I do/don't want to be translated?

Thanks!

È stato utile?

Soluzione

I've answered my own question after doing some digging around.

Chrome translate will ignore all elements with class 'notranslate'.

For example, given the following code:

<strong>Don't translate me</strong>

Adding this will force chrome to ignore it:

<strong class="notranslate">Don't translate me</strong>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top