glossPlural function
The form of a counted phrase for count in context's language (its
Localizations locale, else English): one and other at least, and
zero, two, few and many for the languages that have them. A form
the language uses but the caller left out falls back to other.
glossPlural(context, 3, one: '1 recipe', other: '3 recipes')
Implementation
String glossPlural(
BuildContext context,
int count, {
String? zero,
required String one,
String? two,
String? few,
String? many,
required String other,
}) {
final locale = Localizations.maybeLocaleOf(context) ?? const Locale('en');
return switch (glossPluralCategory(locale, count)) {
GlossPluralCategory.zero => zero,
GlossPluralCategory.one => one,
GlossPluralCategory.two => two,
GlossPluralCategory.few => few,
GlossPluralCategory.many => many,
GlossPluralCategory.other => other,
} ??
other;
}