When pm used in multilingual env - title should be formated with plurals
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | pm_plural_d6.patch | 722 bytes | andypost |
| #4 | pm_plural_d6.patch | 704 bytes | andypost |
When pm used in multilingual env - title should be formated with plurals
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | pm_plural_d6.patch | 722 bytes | andypost |
| #4 | pm_plural_d6.patch | 704 bytes | andypost |
Comments
Comment #1
berdirformat_plural doesn't work for what we are doing there.. format_plurat is hardcoded for 1 or n, but we need 0 or n. And we need to do it always, even if language x doesn't use plural at all.
See #337989-20: Translation of messages menu breaks display of unread messages and my answer below
Comment #2
andypostI post this patch wich works for me
Take a closer look - title changes only if ($count > 0) so there's no problem with plural forms
Comment #3
berdirThere is no patch :)
Comment #4
andypostSorry, attaching again
Comment #5
berdirStill, it doesn't make sense to use format_plural there, you are using the *same* text if there are one or multiple new messages. It would be completely different if it would state something like "1 message" vs. "n messages" but that text wouldn't make sense in that context.
Comment #6
andypostIt's really make sense for Russian language and maybe other - 1 message & n messages (pluralized 1 new and n new writes different)
Comment #7
berdirI see..
patch is easy enough to be set to RTBC.
Comment #8
litwol commentedi modified it to use @count for single counts too, in case some one wants to translate it some how differently.
Comment #9
andypost@litwol Your fix is wrong, check http://api.drupal.org/api/function/format_plural/6 second parameter $singular The string for the singular case. Please make sure it is clear this is singular, to ease translation (e.g. use "1 new comment" instead of "1 new"). Do not use @count in the singular string.
Comment #10
litwol commentedtechnically my solution is not wrong, it gets the same job done differently.
copies these first 4 lines from format_plural that make my patch work as its intended
So this raises a question: is there any non-technical reason your method should be used over the one i chose?
Comment #11
litwol commentedSorry for the title change.
Comment #12
andypost@litwol Because strings for singular and plural should be different! Using gettext with same strings produce same translations. But in this case strings should be different!!! It's really needed else I can't translate this to russian! And maybe some other langs too.
Comment #13
litwol commentedTi prav :-) (English: You're right). Committed the fix.
Comment #14
andypostSpasibo :) Thank you!