File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616from django .db .models .functions import Coalesce
1717from django .http import HttpRequest
1818from django .utils .translation import gettext as _
19- from django .utils .translation import ngettext
2019
2120from hypha .apply .activity .messaging import MESSAGES , messenger
2221from hypha .apply .activity .models import Activity , Event
@@ -43,9 +42,7 @@ def bulk_archive_submissions(
4342
4443 messages .success (
4544 request ,
46- ngettext (
47- "{} submission archived." , "{} submissions archived." , len (submissions )
48- ).format (len (submissions )),
45+ _ ("{count} submissions archived." ).format (count = len (submissions )),
4946 )
5047
5148 messenger (
@@ -78,9 +75,7 @@ def bulk_delete_submissions(
7875
7976 messages .success (
8077 request ,
81- ngettext (
82- "{} submission deleted." , "{} submissions deleted." , len (submissions )
83- ).format (len (submissions )),
78+ _ ("{count} submissions deleted." ).format (count = len (submissions )),
8479 )
8580
8681 messenger (
Original file line number Diff line number Diff line change 66from django .utils .html import format_html
77from django .utils .safestring import mark_safe
88from django .utils .text import slugify
9+ from django .utils .translation import gettext
910from django .utils .translation import gettext_lazy as _
10- from django .utils .translation import ngettext
1111from django_tables2 .utils import A
1212from heroicons .templatetags .heroicons import heroicon_outline
1313
@@ -213,9 +213,7 @@ def render_reporting(self, record):
213213 display = ""
214214
215215 outstanding_count = record .report_config .outstanding_reports ()
216- display += ngettext (
217- "{} outstanding" , "{} outstanding" , outstanding_count
218- ).format (outstanding_count )
216+ display += gettext ("{count} outstanding" ).format (count = outstanding_count )
219217 return mark_safe (display )
220218
221219
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ def clean(self):
161161 valid_opinions = [opinion for opinion in opinions if opinion is not None ]
162162 if len (valid_opinions ) > 1 :
163163 self .add_error (
164- None , gettext ("Cant submit both an agreement and disagreement" )
164+ None , gettext ("Can't submit both an agreement and disagreement" )
165165 )
166166 cleaned_data = {"opinion" : valid_opinions [0 ]}
167167 return cleaned_data
You can’t perform that action at this time.
0 commit comments