Skip to content

feat(i18n): add Latin American Spanish (es) localization - #138

Merged
wflixu merged 1 commit into
wflixu:devfrom
EliasMatDev:feature/spanish-localization
Aug 1, 2026
Merged

wflixu merged 1 commit into
wflixu:devfrom
EliasMatDev:feature/spanish-localization

Conversation

@EliasMatDev

Copy link
Copy Markdown
Contributor

Summary

Adds a complete Latin American Spanish (es) localization for both the main app and the FinderSync extension, and makes the last few user-visible hardcoded strings localizable so they can be translated at all.

  • RClick/Localizable.xcstrings: 156 Spanish strings
  • FinderSyncExt/Localizable.xcstrings: 143 Spanish strings
  • 164 unique strings overall; es registered in knownRegions

English remains the source language and the fallback for unsupported system languages. No existing en, ja or zh-Hans entry was modified — the catalog diff is additive only (verified key by key).

Strings that were not localizable before

Location Was Now
FinderSyncExt.toolbarItemToolTip hardcoded English AppLocalization.localized("RClick: Click for menu options")
Updater.downloadAsset hardcoded "下载失败", shown to the user through UpdateView.errorView key Download failed
Updater.extractAppZip hardcoded "未知错误", interpolated into the visible Extraction failed: %@ key Unknown error

Six keys the UI already referenced were missing from RClick/Localizable.xcstrings and silently fell back to the literal (OK, Save, Add, Display Name, Default Open App, Edit App Properties). They are now present, reusing the zh-Hans/ja values that already existed in the extension's catalog. Every newly introduced key ships en, es, zh-Hans and ja, so no language regresses.

Seed data

ActionEntity.createDefaultActions() and CommonDirEntity.createDefaultCommonDirs() stored hardcoded Chinese names (复制路径, 桌面, …). The UI never showed them — RCAction.displayName and CommonDir.displayName resolve by id — but they were the persisted values and an incorrect English fallback. They now use the English source keys, matching RCAction.all. No id, ordering or behavior change.

Tooling

scripts/check-localization.py validates both catalogs: JSON well-formedness, translation coverage per language, and that every translation preserves the source format specifiers in the same order (%@, %1$@, %lld, …). It is a standalone script, not part of any target.

$ python3 scripts/check-localization.py
OK: 2 catalog(s) valid, every translatable key rendered in es with matching
format specifiers (4 key(s) skipped as non-translatable).

The four skipped keys are bare placeholders with no text ("", %@, %lld, %@(%@)).

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 📝 Documentation update
  • ♻️ Refactoring
  • ⚡ Performance improvement
  • 🔧 Build/CI change
  • 🧪 Test addition/update

Related Issue

None.

Screenshots

The layout is unchanged; only string values differ. Verified on screen with the Settings window in Spanish across all six tabs (General, Apps, Acciones, Nuevo archivo, Carpetas frecuentes, Acerca de).

One pre-existing cosmetic note: the sidebar truncates long labels (Common F… in English today). Spanish has two truncated entries instead of one (Nuevo archi…, Carpetas fr…). This is the fixed navigationSplitViewColumnWidth(220), not a translation length problem — happy to widen it in a separate PR if you want.

Reviewers can check any language without changing system settings:

/path/to/RClick.app/Contents/MacOS/RClick -AppleLanguages "(es-419)"

Testing

Environment: macOS 26.6 (arm64), Xcode 26.6 (17F113).

Manual Testing

  • App launches and appears in menu bar
  • Right-click menu works correctly in Finder — not verified, see note below
  • Dark mode looks correct (verified in dark mode; light mode not checked)
  • Settings persist across restarts
  • FinderSync extension loads properly — not verified, see note below

I have no code-signing identity available, so the FinderSync extension cannot be enabled on my machine and the context menu could not be exercised at runtime. What I did verify instead: the compiled FinderSyncExt.appex ships es.lproj/Localizable.strings with all 143 strings, alongside en, ja and zh-Hans. The action labels resolve through RCAction.displayName in the host app before being sent to the extension, and those keys are covered.

Build Verification

$ xcodebuild -project RClick.xcodeproj -scheme RClick -configuration Debug \
    -destination 'platform=macOS,arch=arm64' CODE_SIGNING_ALLOWED=NO clean build -quiet
EXIT=0   (no new warnings; the two pre-existing `no 'async' operations occur within
          'await' expression` warnings in BookmarkManager.swift are untouched)

$ xcodebuild -project RClick.xcodeproj -scheme RClick -configuration Debug \
    -destination 'platform=macOS,arch=arm64' CODE_SIGNING_ALLOWED=NO test -quiet
EXIT=0
Test suite 'RClickTests' started on 'My Mac'
Test case 'RClickTests/example()' passed (0.000 seconds)

$ xcrun xcstringstool compile RClick/Localizable.xcstrings         # exit 0
$ xcrun xcstringstool compile FinderSyncExt/Localizable.xcstrings  # exit 0

Both bundles were inspected after building: RClick.app and the embedded .appex each contain en.lproj, es.lproj, ja.lproj and zh-Hans.lproj.

Checklist

  • My code follows the project's Swift 6.2 conventions (see CONTRIBUTING.md)
  • All UI is SwiftUI (no AppKit UI components)
  • I have tested on macOS 15.6+ (macOS 26.6)
  • I have tested with both light and dark mode — dark mode only
  • I have updated documentation if needed (no doc change required; README already documents how to add a language)
  • My branch is up-to-date with dev

Additional Notes

  • Terminology follows Apple's Spanish localization: Finder, Ajustes del Sistema, Accesibilidad, Acceso total al disco, Aplicaciones, Papelera. Product names, formats and file extensions are left untouched (RClick, AirDrop, SF Symbol, .pptx, .numbers, …).
  • No changes to logic, architecture, entitlements, bundle identifiers, signing or build configuration. The only project.pbxproj change is the single es entry in knownRegions.
  • The repository docs list three supported languages; I left those tables alone to keep this diff focused, but I'm glad to add Spanish to them if you'd prefer it in the same PR.

Adds a complete es translation for both the main app and the FinderSync
extension, registers es in knownRegions, and makes the last user-visible
hardcoded strings localizable:

- RClick/Localizable.xcstrings: 156 es strings (8 keys added that the UI
  already used but the catalog was missing: OK, Save, Add, Display Name,
  Default Open App, Edit App Properties, plus Download failed / Unknown
  error for the updater)
- FinderSyncExt/Localizable.xcstrings: 143 es strings (adds the Finder
  toolbar tooltip key)
- FinderSyncExt: toolbarItemToolTip now goes through AppLocalization
- Updater: the two remaining Chinese user-facing error strings are now
  localized keys
- Default seed data (actions, common folders) uses the English source
  keys instead of hardcoded Chinese, so displayName lookups and the
  English fallback line up
- scripts/check-localization.py verifies es coverage and that every
  translation keeps the source format specifiers, in order

Newly introduced keys ship en, es, zh-Hans and ja so no language
regresses. English stays the source language and the fallback for
unsupported system languages. No logic, signing, entitlement or
bundle-id changes.
@wflixu
wflixu merged commit 1ad09e8 into wflixu:dev Aug 1, 2026
@Dam0rt Dam0rt mentioned this pull request Sep 10, 2026
9 of 21 tasks
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