Do I need the "lang"-tag for Chrome translation?
Asked Answered
S

2

0

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?

Snobbish answered 23/2, 2016 at 15:7 Comment(0)
C
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>
Chappy answered 23/2, 2016 at 19:38 Comment(0)
L
0

per the HTML spec:

Authors are encouraged to specify a lang attribute on the root html element, giving the document's language. This aids speech synthesis tools to determine what pronunciations to use, translation tools to determine what rules to use, and so forth.

Lawrence answered 26/7, 2022 at 15:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.