EarendelDevelopers / factorio-mods

This is a public repository for tracking issues with Earendel's factorio mods.
19 stars 3 forks source link

Time Counter in Informatron title incorrectly pluralized #290

Closed Astorin closed 1 year ago

Astorin commented 1 year ago

Hello.

I noticed that the time in the Informatron GUI title is incorrectly handled by the pluralization condition in RU locale. Current pluralization string (shorten, for seconds only): __4__ [color=#bbbbbb]__plural_for_parameter_4_{ends in 11,12,13,14=секунд|ends in 1=секунда|ends in 2,3,4=секунды|rest=секунд}__[/color]

There are 4 conditions depending on the number, and the third one is handled incorrectly. When number ends in 3 or 4, i.e. 23 (or 24), result is "23 (24) секунд" as if the first or last condition applies, not the third (correct result "23 (24) секунды"). But the number 22 is handled correctly, result "22 секунды", as it should be.

Where is the error? Informatron mod or pluralization string?

Wiwiweb commented 1 year ago

I think "ends in X,Y,Z" is interpreted as "ends in X, or is exactly Y, or is exactly Z".

caption_test=__1__ __plural_for_parameter_1_{ends in 11,12,13,14=A|ends in 1=B|ends in 2,3,4=C|rest=D}__ image

Wiwiweb commented 1 year ago

This works:

caption_test=__1__ __plural_for_parameter_1_{ends in 11,ends in 12,ends in 13,ends in 14=A|ends in 1=B|ends in 2,ends in 3,ends in 4=C|rest=D}__ image

I was gonna fix it myself but I see there's a bunch of lines where this "ends in X,Y" pattern was used, and I'm not sure if any of them might actually be correct. Can I let you take care of it via a new translation file for next release?

Astorin commented 1 year ago

Aha, so multiple "ends in" must be separated for each number, not just comma separated. Thanks for investigation. I'll update locale file for Informatron mod (and others where I used that form).