-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
symbol can't be argument for :count in east slavic locales #2900
symbol can't be argument for :count in east slavic locales #2900
Conversation
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.
Looks good to me!
Would you mind changing the commit message to something shorter? You can include more description on additional lines below
@bitberries thanks for making this PR! 🎉 We have some great resources for writing good commit messages in our contributing.md file, if you're interested! |
ebeb8c0
to
0f2cc9e
Compare
Changed commit message, is it okay now? |
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.
Much better, thanks!
@bitberries I'm not sure to get the issue with current code and the link provided does not help understanding (for me). Can you please point to some other resource or explain the issue better? |
Just try to visit this page with russian locale and you will get exception. |
Also I never saw that count parameter was not numerical. Everywhere it is number. It is assumed by pluralization rules that it will be a number, check it https://github.com/svenfuchs/rails-i18n/tree/master/lib/rails_i18n/common_pluralizations - everywhere comparisons only with numbers. This code is just randomly working correctly for the English language. |
That's what I was trying to understand, thanks. It looks like it's not supported by I've also found the initial work for this in Solidus: #1191 Are there other occurrences of this wrong pluralization in Solidus? It is worth to update all of them in this PR maybe, what do you think? |
I have not found more similar errors (via grep), but if I notice something like this I will definitely make a pool request! Solidus is great project with clean code (in comparison with spree) and I will help make it better :) |
@bitberries I've just found this one:
This should be unsupported as well. I know that this will not break any thing since specs does not run with east slavic locale but we should not encourage bad practices in the codebase. Every line of code could be taken as example and reused again, maybe somewhere where it will be dangerous. |
Yep, you are right. I fixed it. |
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.
Left a question, also I think you can squash commits and change the commit message to reflect both changes, thanks!
02fc8d3
to
95ae416
Compare
Now using plural_resource_name in spec. |
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 know I suggested to add this but thinking twice it's better to don't add implementation details to the feature specs expectations.
95ae416
to
fc8c072
Compare
Symbol can't be argument for :count in east slavic locales, east slavic pluralization rule requires number because it uses modulo division, https://github.com/svenfuchs/rails-i18n/blob/master/lib/rails_i18n/common_pluralizations/east_slavic.rb
Hi guys!
Symbol can't be argument for :count in east slavic locales, east slavic pluralization rule requires number because it uses modulo division, https://github.com/svenfuchs/rails-i18n/blob/master/lib/rails_i18n/common_pluralizations/east_slavic.rb