Skip to content
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

Set language on document instead of screen #730

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

VincentSmedinga
Copy link
Contributor

On second thought, <html lang="nl"> is better than <Screen lang="nl">.

Even though this explicitly sets the language for the website, the developer still has to remember to do this on the HTML element, for example because the content of some elements can also be in that language.

In addition, on a page in another language e.g. <html lang="ar"> you may forget to also set the (planned) lang prop on Screen, so that the default value of nl kicks in. The fact that developers forget something in itself is not our problem, but we can limit the chance of errors occurring.

So this also documents that implementers should consider this and how.

Sources:

Regarding the language tag of nl instead of nl-NL:

The golden rule when creating language tags is to keep the tag as short as possible. Avoid region, script or other subtags except where they add useful distinguishing information. For instance, use ja for Japanese and not ja-JP, unless there is a particular reason that you need to say that this is Japanese as spoken in Japan, rather than elsewhere.
(…)
Once again, you should only use region subtags if they are necessary to make a distinction you need. Unless you specifically need to highlight that you are talking about Italian as spoken in Italy you should use it for Italian, and not it-IT. The same goes for any other possible combination. – https://www.w3.org/International/articles/language-tags/

@VincentSmedinga VincentSmedinga changed the title Feature/des 490 revert screen lang prop Set language on document instead of screen Nov 8, 2023
Copy link
Contributor

@dlnr dlnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also something to communicate with that standards team and the people who are creating the starter kit.

@github-actions github-actions bot temporarily deployed to staging-feature-DES-490-revert-screen-lang-prop November 9, 2023 09:50 Destroyed
@alimpens alimpens merged commit 25b1ea7 into main Nov 9, 2023
3 checks passed
@alimpens alimpens deleted the feature/DES-490-revert-screen-lang-prop branch November 9, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants