Bug
PluralizeFunction only implements zero, one, and other. The v0_9 spec defines six CLDR plural categories: zero, one, two, few, many, other. The missing three branches make pluralize non-functional for Arabic, Welsh, Polish, Russian, and many other languages.
Spec reference
From basic_catalog.json (v0_9):
"two": { "description": "String for the 'two' category (used in Arabic, Welsh, etc.)." },
"few": { "description": "String for the 'few' category (e.g., small groups in Slavic languages)." },
"many": { "description": "String for the 'many' category (e.g., large groups in various languages)." }
Current implementation
packages/genui/lib/src/catalog/basic_functions.dart
// argumentSchema — missing two/few/many entirely
Schema get argumentSchema => S.object(
properties: {
'count': S.number(),
'zero': S.string(),
'one': S.string(),
'other': S.string(), // two, few, many not declared
},
);
// executeSync — no branch for two/few/many
if (count == 0 && args.containsKey('zero')) return args['zero'];
if (count == 1 && args.containsKey('one')) return args['one'];
return args['other'] ?? ''; // everything else falls here
Comparison with WebCore
WebCore (basic_functions.ts) hard-codes en-US in Intl.PluralRules, which is wrong for non-English locales, but the CLDR category lookup itself works — two/few/many are reachable via the args[rule] lookup. genui does not reach this bar: those categories are absent from both the schema and the implementation.
Related
#902 — pluralize reads wrong key args["count"] instead of args["value"]
Both issues need to be fixed together for pluralize to be spec-conformant.
Bug
PluralizeFunctiononly implementszero,one, andother. The v0_9 spec defines six CLDR plural categories:zero,one,two,few,many,other. The missing three branches makepluralizenon-functional for Arabic, Welsh, Polish, Russian, and many other languages.Spec reference
From
basic_catalog.json(v0_9):Current implementation
packages/genui/lib/src/catalog/basic_functions.dartComparison with WebCore
WebCore (
basic_functions.ts) hard-codesen-USinIntl.PluralRules, which is wrong for non-English locales, but the CLDR category lookup itself works —two/few/manyare reachable via theargs[rule]lookup. genui does not reach this bar: those categories are absent from both the schema and the implementation.Related
#902 —
pluralizereads wrong keyargs["count"]instead ofargs["value"]Both issues need to be fixed together for
pluralizeto be spec-conformant.