message_chk() currently supports two ways of pluralizing a -y noun:
%y returns 'y' if n == 1 and 'ie' otherwise, so it only produces a correct plural when followed by %s (director%y%s).
On its own it yields directorie.
%ies returns 'y' if n == 1 and 'ies' otherwise, so director%ies is correct standalone.
%ies is self-contained and mirrors %s and %es, whereas %y is only correct in composition and silently produces a malformed word otherwise.
Having both is redundant and the failure mode of %y is easy to hit.
Proposal:
- Document
%ies as the supported type and mark %y as deprecated.
- Deprecate with
lifecycle::deprecate_soft() when a message containing %y is processed, pointing users at %ies.
- Update the
message_chk() examples and any internal messages using director%y%s to use director%ies.
Note the deprecation warning has to be raised from inside replace_types_chk() (or message_chk()), which fires whenever n is supplied, so the messaging path needs care to avoid warning on every call.
Follows on from #293.
message_chk()currently supports two ways of pluralizing a-ynoun:%yreturns'y'ifn == 1and'ie'otherwise, so it only produces a correct plural when followed by%s(director%y%s).On its own it yields
directorie.%iesreturns'y'ifn == 1and'ies'otherwise, sodirector%iesis correct standalone.%iesis self-contained and mirrors%sand%es, whereas%yis only correct in composition and silently produces a malformed word otherwise.Having both is redundant and the failure mode of
%yis easy to hit.Proposal:
%iesas the supported type and mark%yas deprecated.lifecycle::deprecate_soft()when a message containing%yis processed, pointing users at%ies.message_chk()examples and any internal messages usingdirector%y%sto usedirector%ies.Note the deprecation warning has to be raised from inside
replace_types_chk()(ormessage_chk()), which fires whenevernis supplied, so the messaging path needs care to avoid warning on every call.Follows on from #293.