Skip to content

feat: Arabic (ar) localization + sidebar localization fix#70

Open
zeck00 wants to merge 1 commit intomomenbasel:mainfrom
zeck00:feat/arabic-localization
Open

feat: Arabic (ar) localization + sidebar localization fix#70
zeck00 wants to merge 1 commit intomomenbasel:mainfrom
zeck00:feat/arabic-localization

Conversation

@zeck00
Copy link
Copy Markdown
Contributor

@zeck00 zeck00 commented Apr 22, 2026

Summary

Adds Arabic localization and fixes a long-standing issue where the sidebar stayed in English regardless of the user's locale.

Arabic localization

  • New PureMac/ar.lproj/Localizable.strings with all 137 strings translated using formal Modern Standard Arabic and Apple's standard macOS terminology (e.g. الوصول الكامل إلى القرص for Full Disk Access, سلة المهملات for Trash, المساحة القابلة للإزالة for Purgeable Space)
  • New docs/README.ar.md with dir="rtl" blocks for proper RTL rendering on GitHub
  • Arabic added to the language switcher across the main README and all 4 existing translated READMEs

Sidebar localization fix (benefits every locale)

While testing Arabic I noticed the sidebar stayed in English even when other parts of the UI translated. Root cause: MainWindow.swift passed raw String values to Section() and Label(), which bypasses SwiftUI's LocalizedStringKey lookup entirely.

  • MainWindow.swift: sidebar groups (Home, Applications, Cleaning) and items (Installed Apps, Orphaned Files) now use LocalizedStringKey. Category labels use LocalizedStringKey(category.rawValue) so the existing translated category names (Smart Scan, System Junk, etc.) finally appear in the sidebar
  • EmptyStateView.swift: title / description / actionLabel are now LocalizedStringKey so the default landing-state text translates too
  • Added the 6 new sidebar keys (Home, Applications, Cleaning, Installed Apps, Orphaned Files, "Select a category from the sidebar to get started.") to all 6 .strings files — en, ar, es, ja, zh-Hans, zh-Hant

This fix means Spanish, Japanese, Simplified Chinese, and Traditional Chinese users finally see the sidebar in their language too.

Notes

  • Only the .strings files, view code, and READMEs are committed — the Xcode project regenerates via xcodegen (same pattern as PR Add Japanese (ja) localization #41 and feat: Spanish (es) localization + multilingual README #65)
  • EmptyStateView's parameter type change is source-compatible: every existing call site passes string literals, which auto-convert to LocalizedStringKey
  • macOS keeps NavigationSplitView sidebars on the left even in RTL languages — this matches Apple's own apps (System Settings, Finder), so no layout-direction override is needed

Test plan

  • Run xcodegen generatear should appear in knownRegions
  • Build and launch with Arabic forced: defaults write com.puremac.app AppleLanguages -array ar en && open /Applications/PureMac.app
  • Verify sidebar sections (Home, Applications, Cleaning) appear in Arabic
  • Verify sidebar items (Smart Scan, Installed Apps, Orphaned Files, etc.) appear in Arabic
  • Verify the same fix works for Spanish: defaults write com.puremac.app AppleLanguages -array es en — sidebar should now show Inicio / Aplicaciones / Limpieza
  • Reset: defaults delete com.puremac.app AppleLanguages

🤖 Generated with Claude Code

- Add Arabic localization (PureMac/ar.lproj/Localizable.strings, 137 strings)
  using formal MSA / Apple's standard macOS terminology
- Add Arabic README (docs/README.ar.md) with RTL-aware blocks
- Add Arabic to the language switcher across all translated READMEs
- Localize the sidebar in MainWindow.swift: groups (Home, Applications,
  Cleaning) and items (Installed Apps, Orphaned Files) now use
  LocalizedStringKey instead of raw String, so all locales — not just
  Arabic — finally translate properly
- Localize EmptyStateView's title/description/actionLabel as
  LocalizedStringKey so the empty state in MainWindow translates too
- Add the corresponding 6 new sidebar keys to all 6 .strings files
  (en, ar, es, ja, zh-Hans, zh-Hant)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant