Skip to content

Localization

星冉 edited this page Aug 3, 2026 · 1 revision

Localization

中文

Supported choices

The app supports Follow System, English, and Simplified Chinese. English is the development fallback for identifiers, comments, logs, diagnostics, and missing UI translations. User-visible application text is localized; logs and protocol/error details do not change with UI language.

Current implementation

Localizable.xcstrings is the String Catalog. The persisted app language is loaded with application settings and exposed through AppState.resolvedLocale; app scenes and hosted presentation roots receive that locale environment. AppLocalization in MacOSCompatibility.swift resolves runtime keys for AppKit menus and other independently hosted/transient UI so they honor the in-app language instead of silently following only the macOS system language.

Use String(localized:), SwiftUI localization keys, or the shared app-aware resolver. Do not introduce Android-style TextPair, hard-coded English/Chinese branches, or page-local translations.

Adding copy

  1. Add an English key and Simplified Chinese translation to Localizable.xcstrings.
  2. Use the localization mechanism appropriate to SwiftUI or an AppKit/transient surface.
  3. Localize labels, errors shown to users, prompts, help text, empty states, and accessibility descriptions together.
  4. Keep technical diagnostic detail in English; map it to a safe localized summary when it reaches UI.

Verification

Test Follow System, English, and Simplified Chinese for normal pages, sheets/alerts, menus, prompts, and accessibility text. Check interpolation/plural formatting in both languages and retain in-progress state while switching when the framework permits it.

Clone this wiki locally