问题
do I need the <html lang="de-DE">
-tag for the Chrome translation? Or does Chrome also analyze the words used in the body-part to check in which language the page was written?
Or do I need to add the <html lang="de-DE">
-tags at divs at the site?
An what when I use more than one language?
回答1:
The Chrome browser can identify the page language by looking at a number of factors:
1.the character encoding.
2.the HTTP headers.
3.the encoding meta tag.
4.Analysis of the actual characters or words on the page.
So yes you need <html lang="de-DE">
-tag.
If you want to use multiple languages for some content u can use elements such as span or div around the content. Here is an example:
<p>If you want to wish hello to someone in hindi.You would say <span lang="hi"> नमस्ते </span>. Namaste</p>
来源:https://stackoverflow.com/questions/35581024/do-i-need-the-lang-tag-for-chrome-translation