Repository navigation
i18n: add L10n pattern, lang verifier and first migrated call sites - #43
Merged
ThoriaDevelopment merged 1 commit intoOct 12, 2026
Merged
Conversation
First, reviewable slice of ThoriaDevelopment#25 as requested in its review: the L10n chokepoint, the verify_contribution.py language-asset check, en_us.json keys, and four migrated call sites (HudOverlay, PlayerSearchScreen, TranscriptPanelScreen, WatchState). No translations are included. The verifier's generated-key pins (check descriptions, presets, keybind hub rows, tier labels) are left for the migration PR, since those call sites are not on L10n yet. Co-authored-by: Rgxaa <169570958+Rgxaa@users.noreply.github.com>
9 of 16 tasks
5 of 9 tasks
ThoriaDevelopment
pushed a commit
that referenced
this pull request
Nov 1, 2026
Ships the call-site migration on top of the L10n pattern from #43: 668 en_us keys, zh_cn at full key parity, verifier pins for runtime-assembled keys (check descriptions, preset labels/blurbs, keybind ids, Tier constants), and tests for L10n's fail-open path. Known limitations, recorded in the PR: zh_cn is machine-translated and has no native-speaker review, and /ius debugfps was never run to measure the uncached per-frame lookup.
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.
Summary
First reviewable slice of #25, split out as requested in that PR's review. It adds the
L10ntranslation chokepoint, a language-asset check inverify_contribution.py, theen_us.jsonkeys, and four migrated call sites (HudOverlay,PlayerSearchScreen,TranscriptPanelScreen,WatchState). No translations are included.The verifier's generated-key pins (check descriptions, presets, keybind hub rows, tier labels) are left for the migration PR, since those call sites aren't on
L10nyet.Changes
dev.iustitia.i18n.L10n:t(key, args)returnsTextands(key, args)returnsString. It is fail-open: an unknown key renders as the key, and a malformed%spec renders the raw entry instead of vanilla's "Format error". Lookups aren't cached, so a language change applies without a restart.iustitia.*keys inen_us.json. The English text is identical to the old literals, including§colour codes.verify_contribution.py --staticnow checks that:en_us.json;%specs are valid;§counts match English;pluralSuffix.CONTRIBUTING.mdgets a "User-facing text" section, and the PR template gets a "Localization/translation strings" area.Affected areas
Verification
Commands run (branch head
cd66664):Results:
build/selftest-manifest.jsonbefore the first live run, anden_us.json key 'key.category.iustitia.keybinds' is not referenced by any L10n call. That key is used by the keybinding category, not throughL10n, so the warning is a false positive:key.category.isn't in the verifier's namespace list.BUILD SUCCESSFUL, 49 tests, 0 failures, 0 errorsBUILD SUCCESSFULLive client verification
runClientGameTest, andpipeline-smokepassed (1/1).runClientcheck that the player-search screen, transcript panel, HUD panel and watch-cancel chat show the same English text as before.Safety and privacy review
Documentation and migration
CONTRIBUTING.md, PR template.)AI assistance
L10nhelper, verifier check, key extraction and call-site migration, and ran the static verifier, Gradle test/build and the live smoke test above.Known limitations and follow-up work
L10n.scomment mentionsCheckInfo/FeatureInfo/Keybindsrelying on the "key returned when missing" sentinel. Those call sites only move in the follow-up PR.iustitia.hud.confidenceHeadpasses the colour code letter as a%sargument (§%s[...]). Translators need to keep that§%sintact. The verifier's§-count check catches a dropped§, but not a reordered one.key.category.iustitia.keybinds(see above) could be silenced by addingkey.category.iustitia.to the namespace list.HudOverlay.kt. Whichever merges second needs a rebase.