Page 1 of 1

[Genhis] [1.1.94] Plural forms in locale break when given a non-integer number

Posted: Sat Nov 04, 2023 5:55 pm
by curiosity
To reproduce:
1. Make the following locale entry: n-items=__1__ __plural_for_parameter_1_{1=item|rest=items}__
2. Launch the game and run the following command: /c game.print{'n-items', 0.5}
3. Observe the following output: 0.5 1

Expected behavior:
The "rest" form gets used, producing the following output: 0.5 items

Comment:
There should probably be more pluralization categories to properly support non-integer pluralization, but that's beyond the scope of a bug report. The proposed above fix would not get in the way of adding such categories in the future: since these categories don't exist now, there would be no conflict with existing mods should you wish to add them.

Re: [Genhis] [1.1.94] Plural forms in locale break when given a non-integer number

Posted: Sun Nov 05, 2023 3:48 pm
by Genhis
Thanks for the report. This has been broken for a long time and is unlikely to get fixed in 1.1. For 2.0, I refactored the localization code and adding proper decimal numbers support is on my to-do list.

Re: [Genhis] [1.1.94] Plural forms in locale break when given a non-integer number

Posted: Mon Nov 06, 2023 12:15 am
by curiosity
I see. Thank you for telling me. Workaround time, I guess.

Re: [Genhis] [1.1.94] Plural forms in locale break when given a non-integer number

Posted: Sun Dec 10, 2023 5:24 pm
by curiosity
FYI, it doesn't understand negative numbers either.

Re: [Genhis] [1.1.94] Plural forms in locale break when given a non-integer number

Posted: Wed May 22, 2024 4:54 pm
by Genhis
This has been fixed for 2.0. All decimal numbers will match "decimal" or "rest" patterns. Negative numbers will behave as positive numbers.

Re: [Genhis] [1.1.94] Plural forms in locale break when given a non-integer number

Posted: Wed May 22, 2024 7:28 pm
by curiosity
That's great news! Thank you.