Language: follow the system language by default (#10138) (#10183)

* claim: #10138

* Follow the system language on a first start (#10138)

The language preference defaults to a new 'system' value: the OS locale
(sys-locale) is matched against the catalog list - exact tag, base
language, then English - and a System choice sits at the top of the
Preferences language list. A saved language still wins.

* Drop the explicit deref clippy flagged; regenerate THIRD-PARTY-LICENSES.txt for sys-locale

---------

Co-authored-by: Dahak Builds <dahakbuilds@users.noreply.github.com>
This commit is contained in:
Dahak Builds
2026-10-31 19:50:08 +00:00
committed by GitHub
parent 8be56316f6
commit 538d7fcb43
19 changed files with 215 additions and 35 deletions
+7
View File
@@ -5,6 +5,13 @@ Japanese, Korean, Malay, Norwegian Bokmål, Dutch, Polish, Brazilian Portuguese,
embedded catalog and one registration there; the preferences selector and validation use the same
registry.
The `language` preference is a registered locale ID, or `system` (the default on a first start):
the app then matches the system's preferred locales — the OS locale on desktop,
`navigator.languages` in the browser, read with the `sys-locale` crate — against the registry:
exact tag, then base language, then English (`match_system_tags` in
`crates/ui-egui/src/i18n.rs`). A saved specific language always wins, so existing users keep
their choice.
## Messages
`assets/locales/en.json` defines stable message IDs and English fallback text.