Skip to content

Add localization infrastructure and Simplified Chinese translation#643

Closed
serenNan wants to merge 3 commits into
supabitapp:mainfrom
serenNan:pr-629
Closed

Add localization infrastructure and Simplified Chinese translation#643
serenNan wants to merge 3 commits into
supabitapp:mainfrom
serenNan:pr-629

Conversation

@serenNan

Copy link
Copy Markdown
Contributor

Closes #629

Summary

Implements #629: adds Apple localization infrastructure and ships Simplified Chinese (zh-Hans) as the first translation.

  • Infrastructure — enables SWIFT_EMIT_LOC_STRINGS to extract LocalizedStringKey literals at build time, declares en + zh-Hans in CFBundleLocalizations, and adds Localizable.xcstrings (English source of truth) wired into the Tuist project. Existing SwiftUI Text/Label call sites keep working unchanged.
  • Translationszh-Hans for 450 user-facing strings across settings, sidebar, toolbar, onboarding, notifications, and the command palette. Anything untranslated falls back to English.
  • In-app language switcher — a General-settings picker (Follow System / English / 简体中文) that persists the choice and offers a one-tap relaunch to apply it, layered on top of the system per-app language override.

The app follows the system language by default; the in-app picker is an optional convenience.

Commits are split so each is easy to review in isolation:

  1. Add Simplified Chinese localization infrastructure — catalog + project wiring only.
  2. Add in-app language switcher in General settings — the picker, AppLanguage model, relaunch, and unit tests.
  3. Translate UI to Simplified Chinese — the zh-Hans catalog entries.

Type of change

  • Bug fix (the linked issue is a bug report)
  • Feature (the linked issue is a feature request marked ready)
  • Documentation
  • Other (please describe)

Note: #629 is a feature request that a maintainer still needs to mark ready. The policy check will flag this until then — happy to wait for approval or adjust scope.

How was this tested?

  • make check passes (format + lint) — ran swift-format lint --strict and swiftlint over the changed files; clean.
  • make test passes — ran the new AppLanguage / settings-language unit tests (8 tests, all green) via xcodebuild test; leaving the full suite to CI.
  • I built and ran the app to confirm the change works — verified the UI renders in Simplified Chinese and the in-app switcher applies the language after relaunch.

AI tool disclosure (optional)

  • Model(s): Claude Opus 4.8
  • Harness / tools: Claude Code

Checklist

serenNan and others added 3 commits July 12, 2026 14:10
Wire up the String Catalog toolchain so UI strings can be translated:
- Enable SWIFT_EMIT_LOC_STRINGS to extract LocalizedStringKey literals
- Declare en and zh-Hans in CFBundleLocalizations
- Add an empty Localizable.xcstrings as the translation source of truth

No translations yet; this is the scaffolding for subsequent batches.

(cherry picked from commit e4f252c)
Add an AppLanguage preference (system / English / Simplified Chinese)
persisted to UserDefaults and mirrored into AppleLanguages, synced at
launch. A General → Language picker writes the choice and, when it
differs from the launch language, offers a one-click relaunch handled
by AppFeature via AppRelauncher. Covered by AppLanguage model tests and
SettingsFeature reducer tests.

(cherry picked from commit d067ade)
Populate Localizable.xcstrings with zh-Hans translations for the app's
user-facing strings (450 entries), covering settings, sidebar, toolbar,
onboarding, notifications, and the command palette.
@github-actions github-actions Bot added the invalid Does not meet the contribution policy; closed automatically after a few days if left inactive. label Jul 12, 2026
@github-actions

Copy link
Copy Markdown

Thanks for the pull request. It doesn't meet the contribution policy yet, so I've labeled it invalid. Please address the following, then push an update:

Nothing needs to be redone. A pull request left invalid is closed automatically after a few days of inactivity. See CONTRIBUTING.md for the full flow.

@serenNan

Copy link
Copy Markdown
Contributor Author

Closing for now: I opened this before #629 is marked ready. The localization work is complete and the pr-629 branch is ready — I'll reopen this as soon as a maintainer approves #629 with the ready label. Sorry for the premature PR.

@serenNan serenNan closed this Jul 12, 2026
@sbertix

sbertix commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Added ready label to the issue.
I'll review it later once it's reopened, but please remove the language switch from settings. If we support localization, we must do it the "native way".

@serenNan

Copy link
Copy Markdown
Contributor Author

Superseded by #646 (this one couldn't be reopened after a force-push). The language switcher has been removed there per the review feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Does not meet the contribution policy; closed automatically after a few days if left inactive.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Localization support with Simplified Chinese as the first translation

2 participants