Speak the user's language, keyed by the English the app already says - #13
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The UI ships in Spanish, Russian and Simplified Chinese as well as English.
The translation key is the English source text, so there is no catalogue of
identifiers to keep in step with the screen, a translator reads sentences
rather than MainWindow_Btn_Refresh, and anything not yet translated degrades
to readable English instead of to a resource id.
UiTranslator walks the window after InitializeComponent, which is what keeps
the 450 XAML strings out of the diff; code sets its text through Loc.T, or
Loc.F for an interpolated string, whose handler pulls the holes out first so
"Diagnosing {0}…" is what gets looked up and the call site stays a normal
interpolated string.
Tab headers are matched as data by the health-finding router, so the English
original is parked in TabItem.Tag before the header is replaced and the
router now reads Tag ?? Header. Language follows Windows until Preferences
says otherwise, and applies on the next start.
Two layout faults surfaced only once the strings got longer: the System
baseline label column was a fixed 150px, and App.xaml's ComboBox template
renders its selection box from ItemTemplate, which DisplayMemberPath never
sets.
Analyzer prose, model-supplied combo entries, logs and exports stay English
for now.
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.
The UI ships in Spanish, Russian and Simplified Chinese alongside English.
How it works
Loc.T("Refresh")looks up"Refresh". No catalogue of identifiers to keep in step with the screen, a translator reads sentences instead ofMainWindow_Btn_Refresh, and an untranslated string degrades to readable English rather than to a resource id.UiTranslator.Apply(this)walks the window afterInitializeComponent— TextBlocks, content, headers, tooltips, DataGrid columns, context menus, automation names. That is what keeps the ~450 XAML strings out of the diff.Loc.F($"…")uses anInterpolatedStringHandlerthat pulls the holes out before the lookup, so$"Diagnosing {target}…"resolves"Diagnosing {0}…"and every call site stays a normal interpolated string.Assets/i18n/translations.json, embedded: 637 entries × 3 languages.CurrentUICultureuntil Preferences says otherwise (zh-TW/zh-Hantget English, not simplified characters), and applies on the next start.Load-bearing headers
TabItem.Headeris matched as data byOpenHealthSection_Clickagainst section names the analyzers hard-code in English. The translator parks the English original inTabItem.Tagbefore replacing the header, and the router now readsTag ?? Header, so section routing survives every language.Layout faults this surfaced
Auto/MinWidth.App.xaml'sComboBoxtemplate renders its selection box fromItemTemplate, whichDisplayMemberPathnever sets, so the presenter fell through toToString().Verification
LocalizationTestsreads the shipped XAML and fails when a string in it has no entry, checks every entry covers every language, and checks{0}placeholders survive translation. 756 tests pass. Verified on the running app in all three languages viadriver.ps1.Deliberately still English
Analyzer prose (
Services/Diagnosis,Services/Remediation) — findings, recommendations, router guidance; model-supplied combo entries (DiagnosticProfiles,GameProfiles,UseCaseProfiles,TuningPreset, enums); logs and exports.Note:
driver.ps1 selectfinds tabs by UIA name, so a non-English run needs the translated name.