Skip to content

Spanish localization (draft) and English plural forms - #92

Open
ufortstephen wants to merge 2 commits into
mobrava:mainfrom
ufortstephen:spanish-localization
Open

ufortstephen wants to merge 2 commits into
mobrava:mainfrom
ufortstephen:spanish-localization

Conversation

@ufortstephen

Copy link
Copy Markdown

Closes #48

Two commits, as you asked:

  1. Use plural forms for English count strings. English plural variations for every count that can be 1, in both catalogs. Korean and Chinese are untouched: those languages don't inflect, so their entries didn't need changes.
  2. Add Spanish (draft). es in both catalogs, in CFBundleLocalizations for the Mac, Mac App Store and iPhone apps, and in both READMEs.

A correction to what I wrote on the issue

The 5 iPhone strings I said were missing Korean and Chinese (%@ selected, %@ clips, %@ of 2 and the two iCloud upload messages) are not showing English to anyone. The code interpolates Ints, so SwiftUI looks up %lld selected, %lld of 2 and so on, and those keys already have Korean and Chinese in ClipbaraKit/Resources/Localizable.xcstrings. I built the iPhone app and checked the compiled ko.lproj: all five are there in Korean. The %@ entries next to them are unused copies, added in dd7f0ce. I misread the catalog the first time, sorry for the noise.

Two things worth knowing, though I left both alone:

  • Those %lld keys are marked stale in the Kit catalog even though the app uses them. If anyone runs Xcode's "Remove stale strings" on it, the Korean and Chinese for them would be deleted.
  • The %@ copies are unused and could be deleted.

Commit 1: plurals

"1 clips and 1 pinboards" now reads "1 clip and 1 pinboard". The same fix applies to:

  • the history retention and clear-history confirmations
  • import results ("Imported 1 clip.", "Skipped 1 duplicate.")
  • character counts
  • the iPhone delete confirmation
  • the trial days left

Strings with more than one count use a substitution per count, so "1 clip and 3 pinboards" works too. No Swift code changed.

Commit 2: Spanish

Your checklist:

  • Settings, panel, menus, onboarding, alerts: every string in both catalogs, Mac and iPhone (433).
  • Placeholders: checked by script on every string; each one matches the English.
  • Plural forms: every count has Spanish one/many/other forms, including "1 seleccionado" / "3 seleccionados", which needs a plural in Spanish even though the English doesn't.
  • Keyboard shortcut labels: kept as macOS shows them (⌘⇧V, ⌘,).
  • String length: Spanish runs about 30% longer. I shortened the few labels that read long for their spot, but I couldn't see every screen.
  • User content: clip text and pinboard names never go through the catalogs, so they're unchanged.
  • Declared app languages: es added. The App Store description stays with you, as you said.

Terms follow Apple's Spanish: Ajustes for Settings, Ajustes del Sistema, Vista Rápida for Quick Look, and the iOS paths as iOS shows them ("Ajustes > General > Teclado > Teclados > Añadir nuevo teclado"). A pinboard is a tablero and a clip stays a clip. It uses "tú" throughout.

This is a machine draft. I reviewed it and corrected about a hundred strings by hand, but it hasn't been read by a native speaker. If the Reddit user can take a look, es in the two Localizable.xcstrings files is all there is to read.

Checks

  • Mac and iPhone apps build; the compiled bundles include es.lproj.
  • ClipbaraTests pass (106 + 15 tests).
  • iPhone UI tests (in English): history, setup guide, keyboard settings and the paste button pass. The keyboard and share sheet tests fail in my unsigned local build, and they fail the same way on main: the extensions need your signing and app group.
  • Ran the compiled strings for counts of 1 and 3 in English, Spanish, Korean and Chinese. English and Spanish now use the right forms, and Korean and Chinese read exactly as before.
  • Launched the iPhone app in Spanish in the simulator.
  • The diff only adds lines: Xcode's key order and formatting are kept, so Xcode shouldn't reshuffle the files on its next save.

"1 clips and 1 pinboards" and similar strings now read "1 clip and 1
pinboard". Adds English plural variations to every count that can be 1:
the iCloud upload messages, the history retention and clear-history
confirmations, import results, character counts, the iPhone delete
confirmation and the trial days left. Korean and Chinese have no
plural forms, so their translations are unchanged.
Adds es to both String Catalogs, covering Settings, the panel, menus,
onboarding and alerts on Mac and iPhone, and to the declared app
languages in the Mac, Mac App Store and iPhone Info.plists and the
READMEs.

Every placeholder matches the English and every count has its Spanish
plural forms. Keyboard shortcuts stay as macOS shows them (⌘⇧V).
Terms follow Apple's Spanish: Ajustes for Settings, Vista Rápida for
Quick Look; a pinboard is a tablero and a clip stays a clip.

The translations are a machine draft and need review by a native
speaker.

This branch has not been deployed

No deployments
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.

[Localization] Add Spanish support

1 participant