-
Notifications
You must be signed in to change notification settings - Fork 298
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
Count variable for cart/wishlist displayed incorrectly with Portuguese locale. #282
Comments
Hello Stephen, Talking with the first translator of Mezzanine Cartridge to Portuguese, Hilton Medeiros, about this question, he went to look at the current code and found a difference between Spanish and Portuguese plural configurations: Spanish: ..\venv\Lib\site-packages\cartridge\shop\locale\es\LC_MESSAGE\django.po
Portuguese: ..\venv\Lib\site-packages\cartridge\shop\locale\pt_BR\LC_MESSAGE\django.po
Maybe changing the Portuguese configuration to be like the Spanish [ plural=(n != 1) ] will fix this. Besides, he pointed me to a commit where someone has made a workaround on this issue on the french translation: b15d17d But I believe that changing the portuguese translation to use plural=(n != 1) is the better option. |
Did you try it? |
I just tried changing the pt_BR setting from plural=(n > 1) to plural=(n != 1) and it did not worked. Does not matter if we use (n > 1) or (n != 1), we always get "1 item" displayed for zero or one items on the cart. Just for your information, on this post https://lgcooper.wordpress.com/2008/10/08/zero-e-plural-ou-singular/ the author asked ABL (the brazilian portuguese language authority) about the the plural of zero, and the answer was "If the non-existent item is only one, use zero item; If there are several, use zero items". So, to me, on a shop, it's better to use zero items, if possible. Since I couldn't do the way I prefer, I went to the same alternative being used in French b15d17d I left the setting plural=(n > 1) (the original form) and changed the singular phrase from 1 item to %(cart_quantity)s item. And for wishlist I did the same. Now I get "0 item on cart", "1 item on cart", "2 items on cart". I'd prefer "0 items" instead of "0 item", but at least the number is not wrong. |
This is still happening to me. It even happens on the demo site. |
As reported here:
https://groups.google.com/forum/#!topic/mezzanine-users/13aR50Iy0k0
Not sure if this is the cause of the issue, but we should probably change "x items in cart" to be a single piece of translated text, rather than "x items" and "in cart", as it currently is. Unfortunately this probably invalidates all the existing translations for it.
The text was updated successfully, but these errors were encountered: