24.8 · Language matching, plural rules, string catalogs and Info.plist strings
The machinery behind localised text: which language a user gets, how plural forms are chosen, what a string catalog compiles to, and the strings outside your code.
Mental model. Matching, plurals and catalogs are data plus tables, so you can run them: build a bundle, ask it, and read the answer.
Pipeline
Matching, plurals, catalogs, Info.plist.
- How are locale identifiers structured, and how does the system match a user’s language to the localisations you ship?
A locale identifier is built from a language, an optional script and a region (zh-Hant-HK is Chinese, Traditional script, Hong Kong), optionally followed by… - How do plural categories work across languages, and what does a stringsdict or catalog entry have to contain?
Plural rules come from CLDR and assign each number to one of six categories: zero, one, two, few, many and other. Each language uses a subset. English uses one… - How does a string catalog (.xcstrings) work, and which runtime files does the build compile it into?
A .xcstrings file is JSON: a sourceLanguage, and a dictionary of keys, each with per-language localizations. A localisation is a stringUnit with a state (new… - What outside your code needs localising: the app name, permission prompts, shortcuts and the App Store listing?
Not every user-visible string lives in code. The app name under the icon (CFBundleDisplayName) and the permission texts (NSCameraUsageDescription and its…
More in Accessibility & localization
- 24.1 · VoiceOver, accessibility elements and the other ways people use an app
- 24.2 · Dynamic Type, display settings, contrast and touch targets
- 24.3 · Right-to-left layout, bidirectional text and number systems
- 24.4 · Testing localisation, and sorting, calendars and names by locale
- 24.5 · Auditing and testing accessibility, and making it a bar, not a backlog
- 24.6 · Building and testing accessible components
- 24.7 · Adaptive colour, font fallback and mirrored drawing
- 24.9 · Unicode equivalence, word boundaries and regional defaults