Skip to content
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

Open
stephenmcd opened this issue Jan 10, 2016 · 4 comments

Comments

@stephenmcd
Copy link
Owner

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.

@arqeco
Copy link

arqeco commented Jan 11, 2016

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

"Plural-Forms: nplurals=2; plural=(n != 1);\n"

Portuguese: ..\venv\Lib\site-packages\cartridge\shop\locale\pt_BR\LC_MESSAGE\django.po

"Plural-Forms: nplurals=2; plural=(n > 1);\n"

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.

@stephenmcd
Copy link
Owner Author

Did you try it?

@arqeco
Copy link

arqeco commented Jan 12, 2016

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.

@lscasanova
Copy link

This is still happening to me. It even happens on the demo site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants