-
-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: Plural support for Romanian translations #8936
Conversation
* Used in: | ||
* Romanian */ | ||
case 14: | ||
return n == 1 ? 0 : (n == 0 || (n % 100 > 0 && n % 100 < 20)) ? 1 : 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to match the comment.
3 cases, as I read the code, are
- 1
- 0, *1-*19 but not 1
- everything else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment doesn't include the first plural (for non-zero numbers), but everything checks out - the code is used in gettext and it's correct.
First plural form:
7 beers = 7 beri
314 beers = 314 beri
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, there are three noun forms, not three plural forms. First, there's the singular form, then two plural forms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code matches http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html?id=l10n/pluralforms#l
But the comment is off. Only "0" is special, not numbers ending in "00".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you meant now. The ending in [2-9][0-9]
refers to the final two digits as a regular expression. These have the same plural form as all numbers ending in 00 (100, 1000, 100000, etc).
And as a Romanian native I confirm it all works out as exemplified here: https://output.jsbin.com/kagomig
This depends on OpenTTD/eints#40
|
As I'm insufficiently familiar with git and github to confidently take those steps myself, please make the change in |
Wasn't intended for you :) Have fixed the comment, will wait for @frosch123 to finish up the deployment |
Please note that the comment was correct. 0 and *00 use different forms.
The line of code can be checked against the three forms here: https://output.jsbin.com/kagomig |
Yes, but there's nothing special about
I suppose you might argue that the comment is a bit backwards... |
The original comment was correct
The new comment is wrong because it says "special cases for A or B", but "00" is not included in either.
I'm not sure why you'd want to change the original comment, though. |
Description
This PR adds plural support for Romanian translations.
Details
The second plural form always - without exception - has the preposition "de". Examples:
This can be formatted as:
{P bere beri "de beri"}
Is there a better way to format these plurals?