1

I just opened a local HTML file on my disk in Google Chrome. Chrome detected the language the file is in and asked me whether I want to translate it.

The document has no lang attribute. It contains some Hungarian text, Chrome offers translation from Hungarian.

Here is a small file that causes Chrome to offer translation dialog:

<!DOCTYPE html>
<html>
<body>
Tudományegyetem
</body>
</html>

I think this is weird. Does the Chrome send my local files to google for language detection?

EDIT OK, now we have a truly minimal file. I deleted "Eötvös Loránd" (a Hungarian name), and kept a single Hungarian word, that means "university". There is a single accented char in the page now, namely "á" -- Unicode U+00E1 (I use UTF-8 locally). This character is not unique to Hungarian language; it is used in many languages. Chrome still detects Hungarian language.

1 Answers1

2

Usually the HTML page language can be determined by checking the lang HTML attribute. You can find an additional information here: Declaring language in HTML

The lang attribute is a Global Attribute, and can be used on any HTML element.


For example, in the Google CHROME right click on the page and select View Page Source. In opened HTML page look up for something like <html lang="en": in my case it was English. If no language specified the default language English is used.

Therefore, there is no need to send a file to the server to determine the language.

Jackdaw
  • 1,834