Describe the bug
When using offset with plural, the offset is supposed to be subtracted from the value before being substituted into the # format marker, but it's not being subtracted.
{num_guests, plural, offset:1
=0 {{host} does not give a party.}
=1 {{host} invites {guest} to their party.}
=2 {{host} invites {guest} and one other person to their party.}
other {{host} invites {guest} and # other people to their party.}
}
with values from 0-3 gives this set of output:
The host does not give a party.
The host invites Alice to their party.
The host invites Alice and one other person to their party.
The host invites Alice and 3 other people to their party
Expected behavior
The last case should read The host invites Alice and 2 other people to their party. That is, when computing the value for #, it should have had the offset subtracted from it.
The library does correctly subtract the offset when computing the plural form to choose; it's just failing to use the offset for #.
Desktop (please complete the following information):
OS: Windows 10
Browser: Chrome
Version: 77
Additional context
We noticed this as we're upgrading from v2.2.0 (where this did work correctly) to v7.3.1 (where it doesn't).
Which package?
intl-messageformat
Describe the bug When using
offset
withplural
, the offset is supposed to be subtracted from the value before being substituted into the#
format marker, but it's not being subtracted.To Reproduce Steps to reproduce the behavior:
Using the example from http://userguide.icu-project.org/formatparse/messages, I've created a codesandbox that illustrates the issue:
https://codesandbox.io/s/old-river-rinru
Specifically, using the format
with values from 0-3 gives this set of output:
Expected behavior The last case should read
The host invites Alice and 2 other people to their party
. That is, when computing the value for#
, it should have had the offset subtracted from it.The library does correctly subtract the offset when computing the plural form to choose; it's just failing to use the offset for
#
.Desktop (please complete the following information):
Additional context We noticed this as we're upgrading from v2.2.0 (where this did work correctly) to v7.3.1 (where it doesn't).