I'm using the Czech locale. Trying the 6-dev version, translations like "1 item" are broken, showing "@count" to the public.
The plural model for our language (as well as others, Polish for example) is a bit complex, and involves (beside more plurals) also re-using of the singular form, which applies to every count with end-digit being 1, excepting 11. So for example "21 items" shows with singular correctly, called at the appropriate place of format_plural() code after evaluating the plural formula - of course this uses '@count' in Czech translation string for "1 item" ! But if the count is 1, it's called from different point in the code, where '@count' is not available yet. We need '@count' to be available even if English text is only just literally "1 item". It worked well in 5.x.
I'm attaching a patch, which simply just swaps two lines, to provide '@count' where necessary. I also noticed, that the "1 item" t() call missed the language code, as opposed to all the plural forms, so I added this also.
| Comment | File | Size | Author |
|---|---|---|---|
| local-singular.patch | 608 bytes | JirkaRybka |
Comments
Comment #1
JirkaRybka commentedReconsidering the priority - this is not a problem causing any instabilities or the like, but I still think it's "critical", because it breaks quite a few locales, and so SHOULD be fixed before Drupal 6 progress to any non-dev releases, before the translations-creation starts.
Comment #2
meba commentedJiri, can you provide with information how to test this? (Using Czech translation from 5.2 and D6 CVS).
Thanks,
Jakub Suchy
Comment #3
gábor hojtsyWell, this patch makes a lot of sense, even if it does not solve any bugs with the Czech translation. Some languages only have one variant for their plurals (not even two), so they need to use @count in the singular translation too.
Thanks for the patch, committed!
Comment #4
JirkaRybka commentedOh you're right - I forgot this part of a well-formed bug-report.
The info follows:
- Fresh Drupal 6-dev install (today's tarball)
- Enable Locale module
- Import Czech translation (http://ftp.drupal.org/files/projects/cs-5.x-1.5.tar.gz), but do not set it default yet if you're not Czech ;-)
- Create a node (I used Story), promote to front page (default)
- Add a comment
- Go to frontpage
- You'll see (english) "1 comment" on the node.
- Go to admin and set the Czech locale as default.
- Go to frontpage, and you'll see "@count komentář", which should correctly be "1 komentář".
(- Apply my patch and refresh the page - now it says "1 komentář".)
Comment #5
JirkaRybka commentedGábor acted during my slow-style-english-typing :) Thanks.
Comment #6
(not verified) commented