Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
String ID 1989743 (!cnt vote / !cnt votes) cannot be translated as seen in the attached image.
This string is used only in fivestar.theme.inc file and the code is:
...
// We don't directly substitute $votes (i.e. use '@count') in format_plural,
// because it has a span around it which is not translatable.
$votes_str = format_plural($votes, '!cnt vote', '!cnt votes', array(
'!cnt' => '<span ' . $rating_count_microdata . '>' . intval($votes) . '</span>'));
...
Also imho votes_str should better be defined not as
format_plural($votes, '!cnt vote', '!cnt votes'...
but as
format_plural($votes, '1 vote', '!cnt votes'...
Comment | File | Size | Author |
---|---|---|---|
#2 | localization_cnt_votes-2880914-2.patch | 854 bytes | cosolom |
| |||
fivestar-translation-str-1989743.jpg | 38.32 KB | Sahin |
Comments
Comment #2
cosolom CreditAttribution: cosolom commentedWe can't use
format_plural($votes, '1 vote', '!cnt votes'....
because we will lost microdata info in this case.
More right will be replace this (in fivestar.theme.inc)
with this
$votes_str = '<span ' . $rating_count_microdata . '>' . intval($votes) . '</span> ' . format_plural($votes, 'vote', 'votes');
Here is patch for the latest dev