-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
[5.4] Bring the pluralization rules back #17826
Conversation
* | ||
* @param string $locale | ||
* @param int $number | ||
* |
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.
cs
case 'tk': | ||
case 'ur': | ||
case 'zu': | ||
return ($number == 1) ? 0 : 1; |
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.
no need for brackets
case 'xbr': | ||
case 'ti': | ||
case 'wa': | ||
return (($number == 0) || ($number == 1)) ? 0 : 1; |
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.
way too many brackets than needed
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 is copied as is from Symfony's Message Selector.
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 mean the switch statement.
When we dropped Symfony's Translator in #15563, pluralisation rules for different languages were dropped.
This PR brings the rules back.