Skip to content

fix(installer): localize Ursa control strings and correct English wording - #6

Merged
hzqst merged 1 commit into
mainfrom
fix/issue-912-installer-english-translation
Oct 7, 2026
Merged

hzqst merged 1 commit into
mainfrom
fix/issue-912-installer-english-translation

Conversation

@hzqst

@hzqst hzqst commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes MetaHookSv/MetaHookSv#912.

In English mode the installer's own strings were translated, but the Ursa
PopConfirm buttons still rendered as 取消 / 确定:

Image

Root cause

Ursa's SemiTheme ships its built-in control strings (the PopConfirm and
MessageBox buttons) in en-US / fr-FR / zh-CN, and defaults to zh-CN.
App.axaml declares <u-semi:SemiTheme/> without a Locale, and App.axaml.cs
only set Lang.Resources.Culture — the theme's Locale was never touched, so
its buttons stayed Chinese regardless of the selected language.

Verified directly against the shipped package:

default  STRING_MENU_DIALOG_OK = 确定      STRING_MENU_DIALOG_CANCEL = 取消
en-US    STRING_MENU_DIALOG_OK = OK        STRING_MENU_DIALOG_CANCEL = Cancel

Changes

  • App.axaml.cs: resolve the UrsaSemiTheme style and set its Locale from the
    effective culture at startup (zh* → zh-CN, fr* → fr-FR, otherwise en-US).
    This keeps the theme's buttons in sync with the app language.

  • Resources.resx: fix the ungrammatical English strings that were also part of
    the report:

    Key Before After
    ConfirmTitle Confirmed to apply modification? Apply this change?
    ConfirmInstall …this operation cannot be reversed. …This action cannot be undone.
    ConfirmUninstall …this action cannot be reversed. …This action cannot be undone.
    InvalidInstallPath Invalid instal target. Invalid install target.
    FileNotFound Could not found {0}. Could not find {0}.
    DeleteFailed Failed when deleting {0}. Error message {1}. Failed to delete {0}. Error message: {1}.
    SelectFirst Please install mod first. Please install the mod first.
    InstallDone Install Mod finished! Mod installed successfully!
    ResetDone Reset finished Reset finished.
    BuildDirectoryNotFound …the programme. …the program.

Verification

  • dotnet build MetahookInstaller.sln -c Debug — 0 warnings, 0 errors.
  • dotnet run --project tests/MetahookInstaller.FileTests — 33/33 pass.
  • Mechanism verified with a headless Avalonia harness: the XAML-declared
    u-semi:SemiTheme is found via Styles.OfType<Ursa.Themes.Semi.SemiTheme>()
    and setting Locale = en-US yields OK=OK CANCEL=Cancel.

Note: the GUI itself was not launched interactively; verification is the build,
the regression harness, and the locale mechanism probe above.

🤖 Generated with Claude Code

…ding

Ursa's SemiTheme ships its built-in control strings (PopConfirm and
MessageBox buttons) in en-US / fr-FR / zh-CN, defaulting to zh-CN.
The app only set Lang.Resources.Culture, so English mode still showed
Chinese confirm/cancel buttons. Resolve the UrsaSemiTheme style and set
its Locale from the effective culture at startup.

Also fix ungrammatical English resource strings (ConfirmTitle,
InvalidInstallPath, FileNotFound, DeleteFailed, SelectFirst, InstallDone,
ResetDone) and drop the British "programme" spelling in favour of "program".

Fixes MetaHookSv/MetaHookSv#912

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hzqst
hzqst merged commit d9af23c into main Oct 7, 2026
1 check passed
@hzqst
hzqst deleted the fix/issue-912-installer-english-translation branch October 7, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TODO: The english translation from MetahookInstaller need to be fixed

1 participant