-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Pluralization of negative amounts is always :other #270
Comments
This repository is just for the collection and maintenance of Please visit https://github.com/svenfuchs/i18n for the behaviour of |
Hi @kuroda, Thanks for answering. But I think you might have read my post a bit too quickly. The problem I'm referring to is not with Concretely, with the files in this location: https://github.com/svenfuchs/rails-i18n/tree/master/lib/rails_i18n/common_pluralizations Please consider reopening this issue. Best regards, Enrique |
Hi @kikito you raise a good point, and one that I hadn't even considered before. Given how complicated some of these pluralization rules can be, I'd feel uncomfortable just adding an abs() call in I18n's pluralization method without having some kind of confirmation that this is applicable to all locales. Can you post the link to the issue you'e opened? Until the CLDR addresses this issue the quickest/easiest solution might be to just re-submit amended pluralization rules here. |
Hi @tigrish, Here's the ticket I opened: http://unicode.org/cldr/trac/ticket/5415 It doesn't look like it has moved much since I opened it. I assume that the cldr is not able to move very fast.
I'm no linguist, but I can could confirm that Spanish, French, English, Portuguese and Russian do abs() on negative numbers by asking around. It know this is not enough evidence to change all the rules to do abs by default, but it indicates a malfunction on those locales.
I'm pretty confident I can send a pull request wich invokes abs() on the passed param. Is that what you are saying? |
I was more thinking of resubmitting the rules we know we can fix in I'll be more than happy to accept a PR that invokes abs() in the I18n repo once we're confident that that's the right thing to do. |
@kikito You are right. I'm sorry. |
This got worse - I'm now getting an error, like this: I had to remove count from the message content and use .abs myself when passing the :count value. |
hi mkolodziej, You forgot to mention what language is that. Also, please confirm: you also would need i18n to make an 'abs' on the number so it doesn't simply return :other for negative numbers, right? |
Hello there,
Say I want to translate a pluralizable message such as this one:
This works with positive values and 0:
But the way the pluralization rules are written, the
:other
option is returned for all negative numbers. Notably, -1 is treated as other:I know this doesn't look like a bit deal in English, but in other locales such as Russian this might be more complex. Probably they'll want to use
:one
for -1,:few
for -4 and so on. So maybe there is anabs
missing there somewhere. Or maybe not - I don't speak Russian.My point is that negative amounts are always pluralized as
:other
by the lib, but I doubt all languages in the world agree in something like that (It would be too good to be true).Unfortunately, the CLDR table ignores negative numbers. I've opened an issue on the CLDR tracker, but it could take these guys a long time to complete that list.
This lib only has 7 pluralizers, so it should take us less time to sort that out. I don't know the due procedures though - do you guys have one language expert per pluralizer, or something similar?
The text was updated successfully, but these errors were encountered: