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

feat(web): use browser language by default #10849

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

michelheusschen
Copy link
Contributor

@michelheusschen michelheusschen commented Jul 4, 2024

The default language is set using the first match in navigator.languages, with english as fallback. Handling languages like ar-AE which should use the less specific ar, adds some complexity. Although svelte-i18n already uses the less specific language internally, it's not exposed so we can't use it. This means some extra logic is needed to determine which language is selected by default.

Less specific languages such as zh are ignored, because you can't safely choose between zh-Hans or zh-Hant.

@waclaw66
Copy link
Contributor

waclaw66 commented Jul 4, 2024

Fixes #10720. Works for cs now.

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

Am I blind or do we not support dev as a language anymore (to show the keys)

@michelheusschen
Copy link
Contributor Author

It's still there for me

image

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

Oh now it's there, nvm. Thank you! :)

@alextran1502 alextran1502 merged commit 6030349 into main Jul 5, 2024
23 checks passed
@alextran1502 alextran1502 deleted the feat/web-default-browser-language branch July 5, 2024 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants