The use of format_plural()
for showing a string as either singular or plural is wrong, as long as the strings don't contain any count. At the moment a block title is set as follows:
$block->title = format_plural(count($terms), 'Parent term', 'Parent terms');
Neither contain a count. Instead the translation should be:
$block->title = count($terms) == 1 ? t('Parent term') : t('Parent terms');
When using format_plural()
will make the po files both contain a normal translation of 'Parent term' and a format_plural version, which as the documentation states is wrong: "Since t() is called by this function, make sure not to pass already-localized strings to it."
Comment | File | Size | Author |
---|---|---|---|
ctools-format_plural_parent_terms.patch | 639 bytes | lund.mikkel |
Comments
Comment #1
merlinofchaos CreditAttribution: merlinofchaos commentedSeems reasonable. Committed and pushed.