Skip to content

Add English localization via String Catalog#2

Open
dboleslawski wants to merge 1 commit intohuberdf:mainfrom
dboleslawski:add-english-localization
Open

Add English localization via String Catalog#2
dboleslawski wants to merge 1 commit intohuberdf:mainfrom
dboleslawski:add-english-localization

Conversation

@dboleslawski
Copy link
Copy Markdown

Summary

  • Introduces Localizable.xcstrings and InfoPlist.xcstrings, adding English as a translation alongside the existing Chinese UI
  • Chinese stays as the source language; no string literals in code were changed, so the upstream language is preserved
  • English users now see the app in English automatically; Chinese users are unaffected

What changed

  • FreeDisplay/Resources/Localizable.xcstrings — ~130 UI strings with English translations
  • FreeDisplay/Resources/InfoPlist.xcstrings — localizes the screen recording permission description
  • Minor code changes (String(localized:), LocalizedStringKey wrapping) in places where strings were stored in @State / computed properties / service return values — needed because those paths don't auto-localize through SwiftUI's Text overload
  • project.pbxproj regenerated via xcodegen to include the new resource files

Test plan

  • xcodebuild -scheme FreeDisplay -configuration Debug build — passes (warnings unchanged from main)
  • Built .app ships both zh-Hans.lproj and en.lproj under Contents/Resources/
  • Launched with open --args -AppleLanguages '(en)' — menu renders in English
  • Launched with default Chinese locale — UI renders in Chinese as before

Introduces Localizable.xcstrings and InfoPlist.xcstrings. Source language
stays Simplified Chinese; English is added as a translation so the UI
renders in the user's preferred macOS language.

- Localizable.xcstrings: ~130 UI strings translated
- InfoPlist.xcstrings: localizes the screen recording usage description
- String(localized:) wrapping for strings stored in @State / computed
  properties / service return values (error messages, preset names,
  "内建显示屏", color space descriptions)
- Text(LocalizedStringKey(var)) and .help(LocalizedStringKey(var)) for
  custom views that pass String labels to child Text (AdjustRow,
  actionButton, IconOptionButton, ExpandableRow)
- SectionBadge.title and TagBadge.text switched to LocalizedStringKey

No behavioral changes. Build produces zh-Hans.lproj and en.lproj.
@nirajpatel2402
Copy link
Copy Markdown

Thanks for doing this

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants