-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language attribute of <html> should not be set to English by default #5945
Comments
ORF.at ran an apology on their frontpage: https://orf.at/stories/3184880/ Since it's the most popular website after Wikipedia, Google, YouTube and Amazon in Austria, quite a lot people have been affected by this issue. A global template should never enforce regional / localized attributes like language. |
Have encountered this problem, but Chrome only auto-translate if user setting like below, User set Then visiting the page with If user check Removing |
I have no Android device, but from the screenshots of our users there has been no clear warning / prominent indicatior that they are visiting the site in a translated version. The users visit the site with the expectation of a German text, so why should the look if some translation kicks in? Best practice indicates omitting the
|
I believe that using the |
This issue came up in this article: https://www.matuzo.at/blog/lang-attribute/, and I think @mmatuzovic' suggestion of having a css error if you forget to change it is nice: html[lang=""]::before,
html[lang*=" "]::before {
content: "the lang attribute on <html> has been empty";
} |
Maybe I'm too conservative, but I don't think active warnings should be enforced in a default configuration via a generator. Something like Manuel suggests should be part of a CI workflow or your local testing. |
Fixes #5945 `lang="en"` may be wrong to users, use empty string instead. See : h5bp/html5-boilerplate#1542
Fixes #5945 `lang="en"` may be wrong to users, use empty string instead. See : h5bp/html5-boilerplate#1542
Version
4.5.7
Reproduction link
https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/generator/template/public/index.html#L2
Environment info
Steps to reproduce
Look at the template, language attribute is hard set to English.
Look at Vue-bases websites in German and a lot will have this misleading . I fixed it for our sites, but there will be tons of others.
What is expected?
The language attribute on the element of the template should be absent. This will let the user agent decide (e.g. autodetect) the language of the page.
What is actually happening?
Language ist set to "en" (English) by default. If a developer has no knowledge of the effect of the language attribute or overlooks it, this might trigger weird translations and screen reader output in the wrong language.
We had this bug multiple times because we simply overlooked the attribute. User then complained that country and district names were displayed weird. Example: Vienna's district "Liesing" has beed translated to "Lügen", because Google Auto-Translate jumped in and thought the Vue-based site is in English, so it translated a page in German as English back into German.
I think don't providing a default language is the best way, since than the user agent has to decide on its own. Most of the time this will be perfect. If developers really want to switch the language, they should know the lang-attribute an do this on their own.
It even got attention on Reddit …
https://old.reddit.com/r/Austria/comments/j9e2gx/wer_war_schon_mal_im_23_bezirk/
The text was updated successfully, but these errors were encountered: