How Plurals Work
Pluralization seems simple: "1 item" vs "2 items." But languages handle plural forms differently.
The Problem#
In English, we have two forms:
- Singular: "1 file"
- Plural: "0 files", "2 files", "100 files"
But Russian has more forms:
- 1 файл (1 file)
- 2 файла (2 files) — different ending
- 5 файлов (5 files) — yet another ending
- 21 файл (21 files) — back to singular-like form
Japanese doesn't distinguish plural at all. Arabic has six different forms.
Plural Categories#
The Unicode CLDR standard defines six categories that languages can use:
| Category | Example Languages |
|---|---|
zero | Arabic, Welsh |
one | English, German, French |
two | Arabic, Welsh |
few | Russian, Polish, Czech |
many | Russian, Polish, Arabic |
other | All languages (required fallback) |
Each language uses a subset of these. English uses just one and other. Russian uses one, few, many, and other.
The other category is always required. If you skip it, your app will crash or show empty strings.
How .xcstrings Handles Plurals#
When you write Text("\(count) items"), Xcode creates plural variations:
{
"variations": {
"plural": {
"one": {
"stringUnit": { "value": "%lld item" }
},
"other": {
"stringUnit": { "value": "%lld items" }
}
}
}
}How XCStrings Translator Helps#
When translating a plural string, XCStrings Translator:
- Detects the source string has plural variations
- Shows only the categories the target language needs
- Validates that all required categories are filled
Translating to Russian shows one, few, many, and other fields. Translating to German shows just one and other—same as English.
Next Steps#
- Using Plurals in Swift — Write plural-ready Swift code
Want to explore plural rules interactively? Try the Understanding Plural Rules tutorial with a live CLDR category explorer.