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.

  1. How are locale identifiers structured, and how does the system match a user’s language to the localisations you ship? 24.8.1 · L3
    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…
  2. How do plural categories work across languages, and what does a stringsdict or catalog entry have to contain? 24.8.2 · L3
    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…
  3. How does a string catalog (.xcstrings) work, and which runtime files does the build compile it into? 24.8.3 · L3
    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…
  4. What outside your code needs localising: the app name, permission prompts, shortcuts and the App Store listing? 24.8.4 · L2
    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