Skip to content

expand the handling of plurals by the % syntax #293

Description

@StefanoMezzini

Currently, {chk} messages and errors cannot handle the plural for "class" correctly. It can handle "directory" properly:

> message_chk("There %r %n problem director%y%s.", n = 1)
[1] "There is 1 problem directory."
> message_chk("There %r %n problem director%y%s.", n = 2)
[1] "There are 2 problem directories."

to match this behaviour, we would have to allow the %s%ses or %%es syntax to work so that we can switch between "class" and "classes".

> message_chk("There %r %n problem clas%s%es.", n = 1)
[1] "There is 1 problem clas%es."
> message_chk("There %r %n problem clas%s%es.", n = 2)
[1] "There are 2 problem class%es."
> message_chk("There %r %n problem class%%es.", n = 1)
[1] "There is 1 problem class%%es."
> message_chk("There %r %n problem class%%es.", n = 2)
[1] "There are 2 problem class%%es."

Alternatively we could add something like what {cli} does with "director{?y/ies}" to add irregular plurals (e.g., "clas%{s/ses}") and avoid breaking existing functionality.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions