Skip to content

Language attribute of <html> element should not be set to English by default #599

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

Closed
botic opened this issue Nov 4, 2024 · 2 comments · Fixed by #600
Closed

Language attribute of <html> element should not be set to English by default #599

botic opened this issue Nov 4, 2024 · 2 comments · Fixed by #600
Labels
bug Something isn't working

Comments

@botic
Copy link
Contributor

botic commented Nov 4, 2024

The current HTML template explictly sets the language attribute to English with lang="en". This turned out to be a bad pattern if your project is not solely targeting the English-speaking communities. Google Chrome might auto-translate such pages, even if the actual language of the text is in German.

See more details here: vuejs/vue-cli#5945

If not changed, Vite-powered Vue projects will see a high number of false language attributes in the wild!

Code search returned two places with explicit language attribute:

Expected behavior

The language attribute on the element of the template should be absent or empty. This will let the user agent decide (e.g. autodetect) the language of the page.

You can find the vue-cli solution here: vuejs/vue-cli@2373df1

How to reproduce

Just create a new project :-)

@botic botic added the bug Something isn't working label Nov 4, 2024
@cexbrayat
Copy link
Member

Hi @botic

Sure, feel free to open a PR to fix this 👍

@botic
Copy link
Contributor Author

botic commented Nov 4, 2024

Sure, feel free to open a PR to fix this 👍

Sorry, now included. The Nightwatch template should be irrelevant, so it's just the base/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants