Add localization infrastructure and Simplified Chinese translation#643
Closed
serenNan wants to merge 3 commits into
Closed
Add localization infrastructure and Simplified Chinese translation#643serenNan wants to merge 3 commits into
serenNan wants to merge 3 commits into
Conversation
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.
|
Thanks for the pull request. It doesn't meet the contribution policy yet, so I've labeled it
Nothing needs to be redone. A pull request left |
Contributor
Author
Collaborator
|
Added |
11 tasks
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. |
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.
Closes #629
Summary
Implements #629: adds Apple localization infrastructure and ships Simplified Chinese (
zh-Hans) as the first translation.SWIFT_EMIT_LOC_STRINGSto extractLocalizedStringKeyliterals at build time, declaresen+zh-HansinCFBundleLocalizations, and addsLocalizable.xcstrings(English source of truth) wired into the Tuist project. Existing SwiftUIText/Labelcall sites keep working unchanged.zh-Hansfor 450 user-facing strings across settings, sidebar, toolbar, onboarding, notifications, and the command palette. Anything untranslated falls back to English.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:
Add Simplified Chinese localization infrastructure— catalog + project wiring only.Add in-app language switcher in General settings— the picker,AppLanguagemodel, relaunch, and unit tests.Translate UI to Simplified Chinese— thezh-Hanscatalog entries.Type of change
ready)How was this tested?
make checkpasses (format + lint) — ranswift-format lint --strictandswiftlintover the changed files; clean.make testpasses — ran the newAppLanguage/ settings-language unit tests (8 tests, all green) viaxcodebuild test; leaving the full suite to CI.AI tool disclosure (optional)
Checklist
Closes #above.ready. — pending maintainer approval of Localization support with Simplified Chinese as the first translation #629.