Localize Foreman with Xcode 26 generated string symbols#60
Merged
Conversation
Introduce a per-module Localizable.xcstrings for the Foreman app target and ForemanCore, wire the app target's STRING_CATALOG_GENERATE_SYMBOLS build setting and Resources glob in Project.swift, and process ForemanCore's Resources in Package.swift. Groundwork: catalogs are added but not yet referenced. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace every hardcoded literal in the Foreman app views with the type-safe LocalizedStringResource symbols generated from Localizable.xcstrings (Text(.x), Button(.x), .help(.x), Text(.statusFailedReason(reason:)), etc.). The app name and the cursor-agent CLI name stay literal, and dynamic data is passed as placeholder arguments. Co-authored-by: Cursor <cursoragent@cursor.com>
Route worker failure reasons, the scan/save/login errors and config-load fallback, and CursorAgentLocator.NotFoundError through String(localized: .x) against ForemanCore's catalog. The en values match the current literals verbatim, so tests asserting exact reason/message text still pass. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Localization sections to the Foreman and ForemanCore docs (catalog-first keys, named placeholders, no bundle: .module) and note the STRING_CATALOG_ GENERATE_SYMBOLS wiring in the root AGENTS.md. Call out that symbol generation runs only under the Tuist/xcodebuild flow, not plain swift build. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
LocalizedStringResourcereferences (Text(.detailEmptyTitle),String(localized: .workerExitedWithCode(code:)), etc.).Localizable.xcstringsfor both targets (v1.1,manualextraction, named placeholders like%(code)lld/%(message)@). Theenvalues match the previous literals byte-for-byte so tests asserting exact error text still pass; proper nouns (Foreman, cursor-agent) and dynamic data stay literal.resources+STRING_CATALOG_GENERATE_SYMBOLS=YESon the Foreman target inProject.swift, and.process("Resources")on ForemanCore inPackage.swift.AGENTS.md/README.md). Verified symbol generation runs under both the Tuist/xcodebuildflow and a plainswift build(Swift 6.2 builds SwiftPM targets with the Swift Build engine), so ForemanCore compiles either way.Test plan
./swiftformat --lint./ide --no-open(Tuist generate)tuist build Foremantuist test Foreman-macOS-Testsswift build --target ForemanCoreafterrm -rf .build(confirms symbols generate under SwiftPM)Made with Cursor