TransDuck Plurals Demo

Plural forms vary wildly across languages

English has 2 forms (singular/plural). German and Italian have 2. Russian has 3 (one/few/many). Arabic has 6 (zero/one/two/few/many/other).
Watch how the translations change across counts.

English (singular / plural) count = 0 count = 1 count = 2 count = 5 count = 1000

What this looks like in code

# ait_plural picks the correct plural form for the target language
from transduck import ait_plural

# English: "1 night" vs "7 nights"
# German:  "1 Nacht" vs "7 Nächte"
# Arabic:  "ليلتان 2" (dual) vs "ليالٍ 5" (few) vs "ليلة 1000" (other)

ait_plural("{count} night", "{count} nights", count=1)   # → "1 Nacht"
ait_plural("{count} night", "{count} nights", count=7)   # → "7 Nächte"

# TransDuck uses CLDR plural rules to select the right form:
#   English → one, other
#   Russian → one, few, many, other
#   Arabic  → zero, one, two, few, many, other