Page 1 of 1

Plural localization of decimal numbers

Posted: Wed Nov 08, 2023 3:14 pm
by Genhis
Copied from https://crowdin.com/project/factorio/discussions/228

Hello! I am implementing plural localization support for decimal numbers. I want to add another option to `plural_for_parameter` - `decimal`. If specified, all plurals of decimal numbers would translate to `decimal`; otherwise, to `rest`. This covers translations for languages I know (which is likely not good enough).

Linked bug report: 109521

Proposed usage: `__1__ __plural_for_parameter_1_{1=ton,rest=tons,decimal=tons}` (`decimal` is optional)

Examples:

Code: Select all

 0.01 tons
 0.1  tons
 0.5  tons
 1.5  tons
 2.3  tons
 3.18 tons
12.5  tons
17.4  tons
20.5  tons
Does your language need any special rules? How would you translate the examples? Please let me know if you have any questions.

Re: Plural localization of decimal numbers

Posted: Wed Nov 08, 2023 4:14 pm
by mmmPI
One could argue that units shouldn't be plural when quantity is <= 1
Units: Names of units are made plural only when the numerical value that precedes them is more than one. Examples: 0.25 liter (quantity is less than one) and 250 milliliters (quantity is more than one).
https://www.nist.gov/pml/owm/writing-si ... stem-units

I'm not sure this is the best source for arguing.

The official norm for french from France is paywalled but state that instead quantity needs to be >=2 like :

Code: Select all

 0.01 tonne
 0.1  tonne
 0.5  tonne
 1.5  tonne
 2.3  tonnes
 3.18 tonnes
12.5  tonnes
17.4  tonnes
20.5  tonnes
Though not many french would care, it's often 1.99 euro but sometimes people spell it 1.99 euros even if it's technically incorrect.

Re: Plural localization of decimal numbers

Posted: Wed Nov 08, 2023 7:33 pm
by Tertius
For German, the rule is correct. However, you left out an example that should probably be mentioned:

1 Tonne
but
1,0 Tonnen

Re: Plural localization of decimal numbers

Posted: Sun Nov 12, 2023 10:28 pm
by FuryoftheStars
Yeah, as mmmPi pointed out, at least for American English, the original standard format of plural did not apply to decimals between -1 and 1. However, it has over time been increasingly informally spoken as plural. (I may even be guilty of this myself.)

Doing some googling around, government and other high level official sources like that I am able to find all say to use (or demonstratively use) singular in this context. The only ones I'm finding that say to use plural are "style guides" and the like that tend to cater to "common" usage, whether it's technically correct or not. Just like so many other words and terms that seem to shift in their meanings over the centuries and even decades at times....