pluralSimple function
- @Deprecated('Use the main plural() function instead for better language support')
- PluralForm callback()
Legacy function for backward compatibility
This function maintains the old behavior for existing code.
For new code, use the main plural() function which supports
all CLDR pluralization categories.
Implementation
@Deprecated(
'Use the main plural() function instead for better language support')
String pluralSimple(PluralForm Function(TranslateCallback) callback) {
final pluralForm = callback(_internalTranslate);
if (pluralForm.value == 1) {
return translate(pluralForm.one, {
'value': pluralForm.value,
});
}
if (pluralForm.value == 0) {
if (pluralForm.zero != null) {
return translate(pluralForm.zero!, {
'value': pluralForm.value,
});
}
}
return translate(pluralForm.other, {
'value': pluralForm.value,
});
}