Skip to content

feat: in-app language switcher (English/Chinese) with full Chinese localization - #126

Open
nailongooo99 wants to merge 2 commits into
rooootdev:mainfrom
nailongooo99:upstream-pr
Open

feat: in-app language switcher (English/Chinese) with full Chinese localization#126
nailongooo99 wants to merge 2 commits into
rooootdev:mainfrom
nailongooo99:upstream-pr

Conversation

@nailongooo99

Copy link
Copy Markdown

Summary

This PR adds an in-app language switcher to the home screen and introduces full
Simplified Chinese (zh-Hans) localization for the whole UI, so mond can be used
in either English or Chinese without an app restart.

What's included

  • New "Language" section on the home screen (sibling to Logs / Tweaks) with a
    native segmented control, matching the style of the Exploit method picker in
    Settings, to switch between English and 中文.
  • Instant, persistent switching: the selected language applies immediately to
    every view and is saved in UserDefaults, so it survives relaunches.
  • Full Chinese localization of all user-facing strings: home screen, Settings
    (including every toggle description), MobileGestalt editor (tweak names, info
    popups, apply/revert/load alerts), CacheExtra editor, PosterBoard, Tendies
    explorer, HouseArrest file browser, and the startup "Not supported" alert.
  • Context-aware translations using terms common in the Chinese jailbreak
    community (e.g. Respring → 注销, Tweaks → 插件, Stage Manager → 台前调度,
    Dynamic Island → 灵动岛), including fully translated long warnings such as
    the iPadOS Mode risk notice and the Apple Intelligence usage steps.

Design notes

  • English strings in the codebase remain the source of truth. A lightweight
    L10n manager (mond/helpers/L10n.swift) resolves Chinese at runtime and falls
    back to English for any untranslated string.
  • Since PartyUI components (PlainToggle, Alertinator, PlainAlert) take plain
    String rather than LocalizedStringKey, a small in-app localization manager is
    used instead of the system string catalog — this also enables switching
    without restarting the app.
  • L10n is injected as an @EnvironmentObject so views re-render instantly on
    language change; L10n.shared is used for alerts and helper functions.

Testing

  • Builds successfully (Release, unsigned IPA) with the existing GitHub Actions
    workflow.
  • Installed and manually tested on a device: language switching works
    immediately, Chinese renders correctly throughout, and no regressions were
    observed in tweaks or settings.

Notes for maintainers

  • The L10n layer is self-contained; it can be migrated to Xcode String Catalogs
    later if preferred.
  • The Language section is placed at the top of the home list — easy to move if
    you'd prefer a different spot.

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.

1 participant