Configuring String Pluralization in Mobile Applications
"1 item", "2 items", "5 items" — English has two variants: one/other. Russian, Ukrainian, and Polish have six: zero/one/two/few/many/other. Hardcoded logic like if (count == 1) "item" else "items" is a guaranteed bug when localizing to any language with non-trivial pluralization rules.
Correct Mechanism on Each Platform
Android. File res/values-ru/plurals.xml:
<plurals name="items_count">
<item quantity="one">%d item</item>
<item quantity="few">%d items</item>
<item quantity="many">%d items</item>
<item quantity="other">%d items</item>
</plurals>
Call: resources.getQuantityString(R.plurals.items_count, count, count). The first count selects the form, the second substitutes into %d. Common mistake: passing only one argument — then the number doesn't get substituted into the string.
iOS. Use Localizable.stringsdict instead of Localizable.strings for plural forms. Structure is a plist with key, nested NSStringLocalizedFormatKey, and CLDR-based rules. String(format: NSLocalizedString("items_count", comment: ""), count) automatically selects the correct form. For Swift packages with String Catalog (Xcode 15+) — visual editor for plural forms directly in IDE.
Flutter. Package intl, Intl.plural():
Intl.plural(
count,
zero: 'no items',
one: '$count item',
few: '$count items',
many: '$count items',
other: '$count items',
locale: 'en',
);
Or through ARB-files with flutter gen-l10n — pluralization is described in app_en.arb via ICU syntax: {count, plural, one{# item} few{# items} many{# items} other{# items}}. Generator creates type-safe methods.
React Native. i18next + i18next-icu plugin for ICU syntax. Or react-i18next with Intl.PluralRules natively — available on RN 0.70+. Manually via new Intl.PluralRules('en').select(count) — returns string 'one'/'few'/'many'/'other', by which you select the form from the translation object.
Non-standard Cases
Arabic has six forms including dual (2 items — separate form). Chinese and Japanese have one form, but count suffixes depend on the noun (三本の本 — three books). This is not pluralization but a classifier system that Intl.plural doesn't cover.
Fractional numbers: 1.5 hours — which form? By CLDR rules for English, fractional numbers take the other form. Intl.PluralRules knows this; manual logic through % 10 doesn't.
Timeframe: from 4 hours (audit + hardcode replacement) to 2 days (if pluralization spans multiple languages and custom components). Cost is calculated after audit.







