Commons group module (commons_groups.module, lines 297-301) uses this code for a count of group conrtibutors text on commons all groups page (path like this: www.sitename.com/groups):
$contributors_count = $view->total_rows;
$output .= l(t('@contributors_count @contributors', array(
'@contributors_count' => $contributors_count,
'@contributors' => format_plural($contributors_count, 'contributor', 'contributors'),
)), 'node/' . $group->nid . '/contributors');
But it does not allow to translate a count of contributors text correctly (see this) - it does not need to use t() function, as i understood.
This changed code does work correctly:
$output .= l(format_plural($contributors_count, '1 contributor', '@count contributors'),
'node/' . $group->nid . '/contributors');
Thanks.
Comments
Comment #1
fun.boojum commentedComment #2
devin carlson commentedGood catch!
As you mentioned,
format_plural()handles translation itself so passing its output tot()will cause problems.The attached patch removes the call to
t()as is done in the OP.Comment #3
devin carlson commentedTested #2 with an existing Commons installation and confirmed that the group contributor counts could be translated and continued to function properly with translation disabled.
Committed #2 to Commons 7.x-3.x.
http://drupalcode.org/project/commons.git/commit/a6d2038