Closed (outdated)
Project:
Invite
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2011 at 13:02 UTC
Updated:
15 May 2020 at 22:33 UTC
Jump to comment: Most recent
This is wrong:
format_plural(count($failed_emails), 'The following recipient is already a member:', 'The following recipients are already members:');
should be:
if (count($failed_emails) == 1) {
t('The following recipient is already a member:');
}
else {
t('The following recipients are already members:');
}
The problem is that for example in Russian language when the $failed_emails == 21 or 31 .. the singular text 'The following recipient is already a member' will be displayed (translated into Russian).
for example here
http://localize.drupal.org/translate/languages/ru/translate?search=1%20i...
you can see than '1 invitation' is translated as '@count приглашение'
so the singular form does not mean that the count equals 1, it means the first type of formatting for texts with numeric values
Comments
Comment #1
pasquallealso colon should not be part of t()
use:
but that is just a recommendation not a real bug.
Comment #2
pasquallerelated docs: #1295792: document misuse of format_plural
Comment #3
andypost+1 I think that singular form should contain @count as well
Comment #3.0
andypostfix wrong example
Comment #4
ryan osītis commented