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)
CommentFileSizeAuthor
#2 nodecomment_plural.patch2.63 KBcrea

Comments

crea’s picture

Status: Needs review » Active

One 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:

function theme_nodecomments_comment_count($node, $count) {
  return format_plural($count, '1 comment', '@count comments');
}

function theme_nodecomments_new_comments($node, $count) {
  return format_plural($count, '1 new comment', '@count new comments')
}

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.

crea’s picture

Status: Active » Needs review
StatusFileSize
new2.63 KB

Attaching patch that implements approach described above.

crea’s picture

Status: Active » Needs review
crea’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.