Skip to content

pluralize reads wrong key: args["count"] should be args["value"] #902

@BBC6BAE9

Description

@BBC6BAE9

Bug

PluralizeFunction.executeSync reads args['count'] but the spec defines the field as value, not count.

File: `packages/genui/lib/src/catalog/basic_functions.dart`

// current (wrong)
final Object? count = args['count'];

// should be
final Object? count = args['value'];

Spec reference

From `basic_catalog.json` (v0_9):

```json
"value": {
"description": "The numeric value used to determine the plural category."
}
```

The field is named `value` throughout the spec. There is no `count` field in `pluralize.args`.

Impact

Any `pluralize` call will always fall through to the `other` branch because `args['count']` is always `null`, regardless of the actual value passed by the agent.

Related

This is separate from the broader CLDR plural category issue tracked in google/A2UI#1385. That issue covers the missing `two`/`few`/`many` branches and the locale handling; this is a straightforward key name mismatch that makes the function completely non-functional today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions