Conversation
Add Compositor/Localizable.xcstrings (source language en, zh-Hans added to
knownRegions) and route every user-visible string through the catalog.
Coverage:
- menus: File/Edit/View/Select/Image/Filter/Layer items, plus the dynamic
filter and adjustment names via localizedName on FilterKind/AdjustmentKind
- tool rail names and the status-bar hint for every tool (the giant ternary
hint became a switch of LocalizedStringKey literals)
- inspectors: transform, brush, gradient, type, shape, marquee/lasso/wand,
levels, hue/saturation, curves, effects, camera raw, image/canvas size, trim
- every segmented picker that showed an enum rawValue (sampling, selection
mode, blend modes, camera raw pages, units, alignment, ...)
The catalog uses extractionState "legacy" so Xcode does not try to generate
Swift symbols for keys that cannot produce one ("%", "Type", "Feather" vs
"Feather…").
Chinese terminology follows Simplified Chinese Photoshop (图层, 蒙版, 羽化,
色阶, 曲线, 内容感知填充, ...).
Compositor now follows the system language by default, and the new "Language…" item in the app menu lets people override it. - LanguageSettings stores the choice in UserDefaults and writes/removes AppleLanguages accordingly; System removes the override - the panel reuses the existing FloatingPanelController so it matches the Keyboard Shortcuts window - the notice explains that a restart applies the change The switcher is additive: with no selection, macOS already picks English or Simplified Chinese from the system preference.
|
Quick context: I put this together while setting Compositor up for Simplified Chinese users, and kept the terminology aligned with Simplified Chinese Photoshop (图层 / 蒙版 / 羽化 / 色阶 / 曲线 / 内容感知填充) so it reads naturally to anyone coming from PS. Happy to change anything you would prefer — if you would rather merge only the translations and drop the in-app Language menu, I can split that out. Same for wording, terminology, or file layout. The catalog uses extractionState "legacy" deliberately: keys like % , Type, and the Feather / Feather… pair cannot generate valid Swift symbols, and legacy opts them out of symbol generation while keeping runtime lookup working. Thanks for open-sourcing the app. |
|
Thanks for putting this together, and sorry to turn it down. Localization is on hold for now, for the same reasons I gave on #57: Compositor is new and it's just me maintaining it. Localization isn't a one-time contribution, since every string I write from then on needs translating, and I can't review translations in languages I don't read, which would mean shipping text I can't verify. I'll revisit it once things settle, and when I do, a String Catalog is genuinely the useful groundwork. Closing for now. |
What this does
Adds a Simplified Chinese (zh-Hans) localization to Compositor, and a small Language menu so people can override the system language without changing macOS settings.
Two commits:
feat(i18n): localize the interface with a String Catalog (zh-Hans)— addsCompositor/Localizable.xcstrings(source languageen,zh-Hansadded toknownRegions) and routes user-visible strings through it.feat(i18n): add a Language menu (System / English / 简体中文)—LanguageSettingsstores the override inUserDefaults; the panel reuses the existingFloatingPanelController.Coverage
localizedNameonFilterKind/AdjustmentKind(English raw value stays the catalog key).Stringand therefore never localizes; it is now aswitchofLocalizedStringKeyliterals (toolHintMessage).NSAlert(AppKit strings don't flow through SwiftUI's catalog, so they useString(localized:), with%@for the document name).Notes for review
extractionStateis"legacy"in the catalog. Symbol generation can't produce valid Swift identifiers for keys like%,Type, or theFeather/Feather…pair, andlegacyopts those keys out of symbol generation while keeping runtime lookup intact. Build logs before that change were full ofThis key is too close to a reserved keyword/would generate the same symbol.8BPS, internal identifiers).Testing
xcodebuild -project Compositor.xcodeproj -scheme Compositor -configuration Debug buildsucceeds (Xcode 26.1.1, ad-hoc signing).-AppleLanguages (zh-Hans): menus, tool rail, status bar, and the sheets listed above render in Chinese; switching the Language menu to English and back changes the interface after relaunch.zh-Hans.lproj/Localizable.stringsin the built bundle contains the expected keys.