Skip to content

Deprecate %y in favour of %ies in message_chk() #313

Description

@joethorley

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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