Repository navigation
i18n: seven languages, live language setting, language handed to apps (0.4.117) - #138
Merged
Merged
Conversation
…es and apps; 0.4.117 Catalogues for en fr de ru zh pl sk under src/locales, read through src/i18n.py (plural forms by CLDR rule, English fallback, Accept-Language negotiated to a bound). The language setting is live; the console serves /i18n.js to every page, and AppHost hands the language to the apps. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0194znU5X7AzhxHW4wQoKm58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Maître · project thread
Before: no language system; every interface string was written in the pages, and apps knew nothing of the operator's language.
After: one catalogue per language (en, fr, de, ru, zh, pl, sk) under
src/locales/, a livelanguagesetting (empty follows the browser),/i18n.jsserved to every page witht()anddata-i18ninui.JS, and the chosen language handed to apps throughAppHost.language/set_language.How:
src/i18n.py(stdlib only) loads and validates catalogues, picks CLDR plural forms and fills{params}by regex, neverstr.format. English is the fallback;Accept-Languageis negotiated to a bound. The setting is read from the file likeupdate_branch, so saving it is applying it. A language select is added to the console's configuration form. Docs: newDocs/I18n/guide, plus Architecture, AppAPI, Setup, WebConsole design and AGENTS.md.This PR is the system and a seed of shared keys (
common.*,state.*,count.*,language.*). Migrating the existing page strings is the next PR.Tests:
tests/test_i18n.py(124 tests: same keys and params in every language, plural rules checked against the browser'sIntl.PluralRules, hostile headers and catalogues, the console route, apps being told). Unit suite 5046 passed, integration 155 passed.Generated by Claude Code