Skip to content

Commit f1a4781

Browse files
ertglbmispelon
andcommitted
Fix ngettext usages to correctly handle singular forms for all languages
Co-authored-by: Baptiste Mispelon <[email protected]>
1 parent e46a504 commit f1a4781

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

members/admin.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def send_account_invite_mail(self, request, queryset):
5555
self.message_user(
5656
request,
5757
ngettext(
58-
"Sent account invite mail to 1 individual member.",
58+
"Sent account invite mail to %(count)d individual member.",
5959
"Sent account invite mail to %(count)d individual members.",
6060
sent_count,
6161
)
@@ -66,8 +66,11 @@ def send_account_invite_mail(self, request, queryset):
6666
self.message_user(
6767
request,
6868
ngettext(
69-
"Failed to send account invite mail to 1 individual member.",
70-
"Failed to send account invite mail to %(count)d individual members.",
69+
"Failed to send account invite mail to %(count)d individual member.",
70+
(
71+
"Failed to send account invite mail to %(count)d individual"
72+
" members.",
73+
),
7174
failed_count,
7275
)
7376
% {"count": failed_count},
@@ -78,9 +81,9 @@ def send_account_invite_mail(self, request, queryset):
7881
request,
7982
ngettext(
8083
(
81-
"Skipped sending account invite mail to 1 individual member"
82-
" (already has an account linked or an invite mail has been"
83-
" sent)."
84+
"Skipped sending account invite mail to %(count)d individual"
85+
" member (already has an account linked or an invite mail has"
86+
" been sent)."
8487
),
8588
(
8689
"Skipped sending account invite mail to %(count)d individual"

0 commit comments

Comments
 (0)