This bug was introduced in #348034: Support for comment type and plural forms in links.
In some languages for example in russian there are more than 1 plural form. Format_plural() function exists to deal with all these cases. It's for this reason you pass number of entities to that function, so it then can properly translate the entity plural form depending on count. Following code in Nodecomment is absolutely wrong, because
this way @comments becomes (per-contenttype) hardcoded placeholder independent from count value, thus totally killing the point of format_plural() function.
'title' => format_plural($all, '1 @comment', '@count @comments', $tokens)
'title' => format_plural($new, '1 new @comment', '@count new @comments', $tokens)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodecomment_plural.patch | 2.63 KB | crea |
Comments
Comment #1
crea commentedOne more note. With this code format_plural() works but in an ugly way: translator is able to provide node comment plural form, but only if he ignores @comments placeholder completely, and provides single translation for all node types.
Proper way of fixing it is not letting user set plural form in UI (which is pointless because of different plural forms in different languages as I said above) but defining theme functions which user can override to provide different strings per-nodetype. Example:
Note that we provide sensible defaults (strings such as "1 comment" are already defined in core) but pass $node inside so user could insert $node->type checks and return different strings.
Comment #2
crea commentedAttaching patch that implements approach described above.
Comment #3
crea commentedCommitted. http://drupal.org/cvs?commit=364950
Comment #4
crea commented