Closed 8549 closed 1 month ago
I'm so sorry for responding to this so late. You probably have moved on with this already. But if you are still interested or if anyone else comes around wondering about this:
Here is the same snippet from the "Selectors" page (https://projectfluent.org/fluent/guide/selectors.html):
your-rank = { NUMBER($pos, type: "ordinal") ->
[1] You finished first!
[one] You finished {$pos}st
[two] You finished {$pos}nd
[few] You finished {$pos}rd
*[other] You finished {$pos}th
}
running in their own playground (link):
As you can see, it also returns "2th" instead of "2nd". As far as I know, the playground uses the latest versions of fluent packages.
So I ended up investigating more and found out that there is no such option in Number formatting. I believe that the docs wasn't updated correctly. You can't find the "type" option among the available option for Number formatting: https://projectfluent.org/fluent/guide/functions.html#number.
However, I tried looking through Python and Rust implementations of fluent, and saw some code that is responsible for ordinal and cardinal "type" argument. No such argument is allowed in the JavaScript (npm) package though. This seems to be a bug/missing feature in the JS package, and not i18n, which doesn't mess with the arguments at all.
I don't have more information. I'll try to look into raising an issue in the fluent repository and asking about this. Thanks for the report, although this is like 7 months old.
Closing due to inactivity
The third example on the Fluent docs page "Selectors" does not work with grammY's i18n plugin.
MWE
Expected result
Bot replies with "You are 2nd in queue!"
Actual result
Bot replies with "Your are 2th in queue!" Same result if queueLength = 3.