質問

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!

役に立ちましたか?

解決

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>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top