diff --git a/hypha/apply/determinations/templates/determinations/determination_detail.html b/hypha/apply/determinations/templates/determinations/determination_detail.html
index 64d7e57d66..96c362be0d 100644
--- a/hypha/apply/determinations/templates/determinations/determination_detail.html
+++ b/hypha/apply/determinations/templates/determinations/determination_detail.html
@@ -59,7 +59,7 @@
{% if answer %}
{% if answer == True or answer == False %}
- {{ answer|yesno:"Agree,Disagree" }}
+ {{ answer|yesno:_("Agree,Disagree") }}
{% else %}
{{ answer|nh3 }}
diff --git a/hypha/apply/flags/migrations/0002_alter_flag_options.py b/hypha/apply/flags/migrations/0002_alter_flag_options.py
new file mode 100644
index 0000000000..51980878eb
--- /dev/null
+++ b/hypha/apply/flags/migrations/0002_alter_flag_options.py
@@ -0,0 +1,16 @@
+# Generated by Django 5.2.11 on 2026-03-03 14:58
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("flags", "0001_initial"),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name="flag",
+ options={"verbose_name": "flag", "verbose_name_plural": "flags"},
+ ),
+ ]
diff --git a/hypha/apply/flags/models.py b/hypha/apply/flags/models.py
index 8806afce58..d7175d1192 100644
--- a/hypha/apply/flags/models.py
+++ b/hypha/apply/flags/models.py
@@ -2,14 +2,16 @@
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
+from django.utils.translation import gettext_lazy as _
+from django.utils.translation import pgettext_lazy
class Flag(models.Model):
STAFF = "staff"
USER = "user"
FLAG_TYPES = {
- STAFF: "Staff",
- USER: "User",
+ STAFF: _("Staff"),
+ USER: _("User"),
}
target_content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
target_object_id = models.PositiveIntegerField()
@@ -24,3 +26,7 @@ class Flag(models.Model):
settings.AUTH_USER_MODEL,
on_delete=models.PROTECT,
)
+
+ class Meta:
+ verbose_name = pgettext_lazy("computing", "flag")
+ verbose_name_plural = pgettext_lazy("computing", "flags")
diff --git a/hypha/apply/flags/templates/flags/flags.html b/hypha/apply/flags/templates/flags/flags.html
index cb5af13ab2..f4e83ea2b6 100644
--- a/hypha/apply/flags/templates/flags/flags.html
+++ b/hypha/apply/flags/templates/flags/flags.html
@@ -10,9 +10,9 @@
hx-swap="outerHTML transition:true"
hx-target="#submission-flags"
{% if is_flagged %}
- data-tippy-content="Remove from your flagged submissions"
+ data-tippy-content="{% trans 'Remove from your flagged submissions' %}"
{% else %}
- data-tippy-content="Add to your flagged submissions"
+ data-tippy-content="{% trans 'Add to your flagged submissions' %}"
{% endif %}
{% endif %}
>
@@ -36,9 +36,9 @@
hx-swap="outerHTML transition:true"
hx-target="#submission-flags"
{% if is_flagged %}
- data-tippy-content="Remove staff flag"
+ data-tippy-content="{% trans 'Remove staff flag' %}"
{% else %}
- data-tippy-content="Flag for staff review"
+ data-tippy-content="{% trans 'Flag for staff review' %}"
{% endif %}
{% endif %}
>
diff --git a/hypha/apply/funds/admin.py b/hypha/apply/funds/admin.py
index 9ee1880437..150e47c33d 100644
--- a/hypha/apply/funds/admin.py
+++ b/hypha/apply/funds/admin.py
@@ -1,5 +1,6 @@
from django.urls import re_path
from django.utils.safestring import mark_safe
+from django.utils.translation import gettext_lazy as _
from wagtail_modeladmin.helpers import PermissionHelper
from wagtail_modeladmin.options import ModelAdmin, ModelAdminGroup
@@ -94,34 +95,34 @@ class ScreeningStatusAdmin(ModelAdmin):
class SealedRoundAdmin(BaseRoundAdmin):
model = SealedRound
menu_icon = str(AdminIcon.SEALED_ROUND)
- menu_label = "Sealed Rounds"
+ menu_label = _("Sealed Rounds")
list_display = ("title", "fund", "start_date", "end_date")
class FundAdmin(ModelAdmin, RelatedFormsMixin):
model = FundType
menu_icon = str(AdminIcon.FUND)
- menu_label = "Funds"
+ menu_label = _("Funds")
list_display = ("title", "application_forms", "review_forms", "determination_forms")
class RFPAdmin(ModelAdmin):
model = RequestForPartners
menu_icon = str(AdminIcon.REQUEST_FOR_PARTNERS)
- menu_label = "Request For Partners"
+ menu_label = _("Request For Partners")
class LabAdmin(ModelAdmin, RelatedFormsMixin):
model = LabType
menu_icon = str(AdminIcon.LAB)
- menu_label = "Labs"
+ menu_label = _("Labs")
list_display = ("title", "application_forms", "review_forms", "determination_forms")
class ReviewerRoleAdmin(ModelAdmin):
model = ReviewerRole
menu_icon = str(AdminIcon.REVIEWER_ROLE)
- menu_label = "Reviewer Roles"
+ menu_label = _("Reviewer Roles")
class DeletePermission(PermissionHelper, ListRelatedMixin):
@@ -178,7 +179,7 @@ class ReviewerSettingAdmin(SettingModelAdmin):
class ApplyAdminGroup(ModelAdminGroup):
- menu_label = "Apply"
+ menu_label = _("Apply")
menu_icon = str(AdminIcon.APPLY)
items = (
RoundAdmin,
diff --git a/hypha/apply/funds/admin_forms.py b/hypha/apply/funds/admin_forms.py
index 9610c4ba52..89494f1c7c 100644
--- a/hypha/apply/funds/admin_forms.py
+++ b/hypha/apply/funds/admin_forms.py
@@ -55,10 +55,12 @@ def validate_application_forms(self, workflow, forms):
for stage in range(1, number_of_stages + 1):
is_form_present = True if stages_counter.get(stage, 0) > 0 else False
if not is_form_present:
- error_list.append(f"Please provide form for Stage {stage}.")
+ error_list.append(
+ _("Please provide form for Stage {stage}.").format(stage=stage)
+ )
if stage == 1 and stages_counter.get(stage, 0) > 1:
- error_list.append("Only 1 form can be selected for 1st Stage.")
+ error_list.append(_("Only 1 form can be selected for 1st Stage."))
if error_list:
self.add_error(
@@ -66,7 +68,10 @@ def validate_application_forms(self, workflow, forms):
error_list,
)
- def validate_stages_equal_forms(self, workflow, forms, form_type="form"):
+ def validate_stages_equal_forms(self, workflow, forms, form_type=None):
+ if form_type is None:
+ form_type = _("form")
+
if forms.is_valid():
valid_forms = [form for form in forms if not form.cleaned_data["DELETE"]]
number_of_forms = len(valid_forms)
@@ -76,7 +81,7 @@ def validate_stages_equal_forms(self, workflow, forms, form_type="form"):
plural_stage = "s" if number_of_stages > 1 else ""
# External Review Form is optional and should be single if provided
- if form_type == "External Review form":
+ if form_type == _("External Review form"):
if number_of_forms > 1:
self.add_error(
None,
@@ -98,7 +103,7 @@ def validate_stages_equal_forms(self, workflow, forms, form_type="form"):
for form in valid_forms[number_of_stages:]:
form.add_error(
"form",
- "Exceeds required number of forms for stage, please remove.",
+ _("Exceeds required number of forms for stage, please remove."),
)
def validate_paf_form(self, forms):
@@ -114,7 +119,7 @@ def clean(self):
start_date = cleaned_data["start_date"]
if not start_date:
- self.add_error("start_date", "Please select start date.")
+ self.add_error("start_date", _("Please select start date."))
return cleaned_data
diff --git a/hypha/apply/funds/admin_helpers.py b/hypha/apply/funds/admin_helpers.py
index 77da19afcb..3fb755368b 100644
--- a/hypha/apply/funds/admin_helpers.py
+++ b/hypha/apply/funds/admin_helpers.py
@@ -44,9 +44,9 @@ def preview_button(self, obj, classnames_add, classnames_exclude):
cn = self.finalise_classname(classname, classnames_exclude)
return {
"url": reverse("wagtailadmin_pages:view_draft", args=(obj.id,)),
- "label": "Preview",
+ "label": _("Preview"),
"classname": cn,
- "title": "Preview this %s" % self.verbose_name,
+ "title": _("Preview this %s") % self.verbose_name,
}
def get_buttons_for_obj(
@@ -63,7 +63,7 @@ def get_buttons_for_obj(
class FormsFundRoundListFilter(admin.SimpleListFilter):
- title = "usage"
+ title = _("usage")
parameter_name = "form-usage"
def lookups(self, request, model_admin):
@@ -82,7 +82,7 @@ def queryset(self, request, queryset):
class RoundStateListFilter(admin.SimpleListFilter):
- title = "state"
+ title = _("state")
parameter_name = "form-state"
def lookups(self, request, model_admin):
@@ -115,8 +115,8 @@ def copy_form_button(self, pk, form_name, **kwargs):
)
return {
"classname": classname,
- "label": "Copy",
- "title": f"Copy {form_name}",
+ "label": _("Copy"),
+ "title": _("Copy {form_name}").format(form_name=form_name),
"url": self.url_helper.get_action_url("copy_form", admin.utils.quote(pk)),
}
diff --git a/hypha/apply/funds/blocks.py b/hypha/apply/funds/blocks.py
index 4416796e91..50061a6129 100644
--- a/hypha/apply/funds/blocks.py
+++ b/hypha/apply/funds/blocks.py
@@ -2,6 +2,7 @@
from django import forms
from django.utils.translation import gettext_lazy as _
+from django.utils.translation import ngettext_lazy
from wagtail import blocks
from hypha.addressfield.fields import ADDRESS_FIELDS_ORDER, AddressField
@@ -27,7 +28,7 @@ class ApplicationMustIncludeFieldBlock(MustIncludeFieldBlock):
class TitleBlock(ApplicationMustIncludeFieldBlock):
name = "title"
- description = "The title of the project"
+ description = _("The title of the project")
field_label = blocks.CharBlock(
label=_("Label"), default=_("What is the title of your application?")
)
@@ -50,7 +51,7 @@ def get_field_kwargs(self, struct_value):
class ValueBlock(ApplicationSingleIncludeFieldBlock):
name = "value"
- description = "The value of the project"
+ description = _("The value of the project")
widget = forms.NumberInput(attrs={"min": 0})
field_class = forms.FloatField
@@ -66,7 +67,7 @@ def prepare_data(self, value, data, serialize):
class OrganizationNameBlock(ApplicationSingleIncludeFieldBlock):
name = "organization_name"
- description = "The name of the organization"
+ description = _("The name of the organization")
widget = forms.TextInput()
class Meta:
@@ -75,7 +76,7 @@ class Meta:
class EmailBlock(ApplicationMustIncludeFieldBlock):
name = "email"
- description = "The applicant email address"
+ description = _("The applicant email address")
field_label = blocks.CharBlock(
label=_("Label"), default=_("What email address should we use to contact you?")
)
@@ -96,7 +97,7 @@ class Meta:
class AddressFieldBlock(ApplicationSingleIncludeFieldBlock):
name = "address"
- description = "The postal address of the user"
+ description = _("The postal address of the user")
field_class = AddressField
@@ -122,7 +123,7 @@ def prepare_data(self, value, data, serialize):
class FullNameBlock(ApplicationMustIncludeFieldBlock):
name = "full_name"
- description = "Full name"
+ description = _("Full name")
field_label = blocks.CharBlock(label=_("Label"), default=_("What is your name?"))
help_text = blocks.RichTextBlock(
required=False,
@@ -145,55 +146,29 @@ class Meta:
class DurationBlock(ApplicationSingleIncludeFieldBlock):
name = "duration"
- description = "Duration"
+ description = _("Duration")
DAYS = "days"
WEEKS = "weeks"
MONTHS = "months"
- DURATION_TYPE_CHOICES = ((DAYS, "Days"), (WEEKS, "Weeks"), (MONTHS, "Months"))
+ DURATION_TYPE_CHOICES = (
+ (DAYS, _("Days")),
+ (WEEKS, _("Weeks")),
+ (MONTHS, _("Months")),
+ )
DURATION_DAY_OPTIONS = {
- 1: "1 day",
- 2: "2 days",
- 3: "3 days",
- 4: "4 days",
- 5: "5 days",
- 6: "6 days",
- 7: "7 days",
+ i: ngettext_lazy("{} day", "{} days", i).format(i) for i in range(1, 8)
}
DURATION_WEEK_OPTIONS = {
- 1: "1 week",
- 2: "2 weeks",
- 3: "3 weeks",
- 4: "4 weeks",
- 5: "5 weeks",
- 6: "6 weeks",
- 7: "7 weeks",
- 8: "8 weeks",
- 9: "9 weeks",
- 10: "10 weeks",
- 11: "11 weeks",
- 12: "12 weeks",
+ i: ngettext_lazy("{} week", "{} weeks", i).format(i) for i in range(1, 13)
}
DURATION_MONTH_OPTIONS = {
- 1: "1 month",
- 2: "2 months",
- 3: "3 months",
- 4: "4 months",
- 5: "5 months",
- 6: "6 months",
- 7: "7 months",
- 8: "8 months",
- 9: "9 months",
- 10: "10 months",
- 11: "11 months",
- 12: "12 months",
- 18: "18 months",
- 24: "24 months",
- 36: "36 months",
+ i: ngettext_lazy("{} month", "{} months", i).format(i)
+ for i in [*range(1, 13), 18, 24, 36]
}
field_class = forms.ChoiceField
duration_type = blocks.ChoiceBlock(
- help_text=(
+ help_text=_(
"Duration type is used to display duration choices in Days, Weeks or Months in application forms. "
"Be careful, changing the duration type in the active round can result in data inconsistency."
),
diff --git a/hypha/apply/funds/forms.py b/hypha/apply/funds/forms.py
index cab7bb1c0a..3764488fbc 100644
--- a/hypha/apply/funds/forms.py
+++ b/hypha/apply/funds/forms.py
@@ -408,7 +408,7 @@ class UpdateMetaTermsForm(ApplicationSubmissionModelForm):
meta_terms = GroupedModelMultipleChoiceField(
queryset=None, # updated in init method
widget=MetaTermWidget(
- attrs={"data-placeholder": "Select...", "data-js-choices": ""}
+ attrs={"data-placeholder": _("Select..."), "data-js-choices": ""}
),
label=_("Tags"),
choices_groupby="get_parent",
@@ -462,9 +462,9 @@ class Meta:
class InviteCoApplicantForm(forms.ModelForm):
- invited_user_email = forms.EmailField(required=True, label="Email")
+ invited_user_email = forms.EmailField(required=True, label=_("Email"))
role = forms.ChoiceField(
- choices=CoApplicantRole.choices, label="Role", required=False
+ choices=CoApplicantRole.choices, label=_("Role"), required=False
)
project_permission = forms.MultipleChoiceField(
choices=CoApplicantProjectPermission.choices,
@@ -497,7 +497,7 @@ class Meta:
class EditCoApplicantForm(forms.ModelForm):
role = forms.ChoiceField(
- choices=CoApplicantRole.choices, label="Role", required=False
+ choices=CoApplicantRole.choices, label=_("Role"), required=False
)
project_permission = forms.MultipleChoiceField(
choices=CoApplicantProjectPermission.choices,
diff --git a/hypha/apply/funds/migrations/0132_alter_applicationbase_options_and_more.py b/hypha/apply/funds/migrations/0132_alter_applicationbase_options_and_more.py
new file mode 100644
index 0000000000..77235c26f7
--- /dev/null
+++ b/hypha/apply/funds/migrations/0132_alter_applicationbase_options_and_more.py
@@ -0,0 +1,251 @@
+# Generated by Django 5.2.11 on 2026-03-03 14:58
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("funds", "0131_delete_orphaned_attachments"),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name="applicationbase",
+ options={
+ "verbose_name": "application base",
+ "verbose_name_plural": "application bases",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbasedeterminationform",
+ options={
+ "verbose_name": "application base determination form",
+ "verbose_name_plural": "application base determination forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbaseexternalreviewform",
+ options={
+ "verbose_name": "application base external review form",
+ "verbose_name_plural": "application base external review form",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbaseform",
+ options={
+ "verbose_name": "application base form",
+ "verbose_name_plural": "application base forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbaseprojectform",
+ options={
+ "verbose_name": "application base project form",
+ "verbose_name_plural": "application base project forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbaseprojectreportform",
+ options={
+ "verbose_name": "application base project report form",
+ "verbose_name_plural": "application base project report forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbaseprojectsowform",
+ options={
+ "verbose_name": "application base project SOW form",
+ "verbose_name_plural": "application base project SOW forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationbasereviewform",
+ options={
+ "verbose_name": "application base review form",
+ "verbose_name_plural": "application base review forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationform",
+ options={
+ "verbose_name": "application form",
+ "verbose_name_plural": "applications forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationrevision",
+ options={
+ "ordering": ["-timestamp"],
+ "verbose_name": "application revision",
+ "verbose_name_plural": "application revisions",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="applicationsubmission",
+ options={
+ "verbose_name": "application submission",
+ "verbose_name_plural": "application submissions",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="assignedreviewers",
+ options={
+ "verbose_name": "assigned reviewer",
+ "verbose_name_plural": "assigned reviewers",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="coapplicant",
+ options={
+ "verbose_name": "co-applicant",
+ "verbose_name_plural": "co-applicants",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="coapplicantinvite",
+ options={
+ "verbose_name": "co-applicant invite",
+ "verbose_name_plural": "co-applicant invites",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="fundtype",
+ options={"verbose_name": "Fund", "verbose_name_plural": "Funds"},
+ ),
+ migrations.AlterModelOptions(
+ name="labbase",
+ options={"verbose_name": "lab base", "verbose_name_plural": "lab bases"},
+ ),
+ migrations.AlterModelOptions(
+ name="labbasedeterminationform",
+ options={
+ "verbose_name": "lab base determination form",
+ "verbose_name_plural": "lab base determination forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labbaseexternalreviewform",
+ options={
+ "verbose_name": "lab base external review form",
+ "verbose_name_plural": "lab base external review forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labbaseform",
+ options={
+ "verbose_name": "lab base form",
+ "verbose_name_plural": "lab base forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labbaseprojectform",
+ options={
+ "verbose_name": "lab base project form",
+ "verbose_name_plural": "lab base project forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labbaseprojectreportform",
+ options={
+ "verbose_name": "lab base project report form",
+ "verbose_name_plural": "lab base project report forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labbaseprojectsowform",
+ options={
+ "verbose_name": "lab base project SOW form",
+ "verbose_name_plural": "lab base project SOW forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labbasereviewform",
+ options={
+ "verbose_name": "lab base review form",
+ "verbose_name_plural": "lab base review forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="labtype",
+ options={"verbose_name": "Lab", "verbose_name_plural": "Labs"},
+ ),
+ migrations.AlterModelOptions(
+ name="reminder",
+ options={
+ "ordering": ["-time"],
+ "verbose_name": "reminder",
+ "verbose_name_plural": "reminders",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="requestforpartners",
+ options={"verbose_name": "RFP", "verbose_name_plural": "RFPs"},
+ ),
+ migrations.AlterModelOptions(
+ name="reviewerrole",
+ options={
+ "verbose_name": "reviewer role",
+ "verbose_name_plural": "reviewer roles",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="round",
+ options={"verbose_name": "Round", "verbose_name_plural": "Rounds"},
+ ),
+ migrations.AlterModelOptions(
+ name="roundbase",
+ options={
+ "verbose_name": "round base",
+ "verbose_name_plural": "round bases",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="roundbasedeterminationform",
+ options={
+ "verbose_name": "round base determination form",
+ "verbose_name_plural": "round base determination forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="roundbaseexternalreviewform",
+ options={
+ "verbose_name": "round base externa review form",
+ "verbose_name_plural": "round base external review forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="roundbaseform",
+ options={
+ "verbose_name": "round base form",
+ "verbose_name_plural": "round base forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="roundbasereviewform",
+ options={
+ "verbose_name": "round base review form",
+ "verbose_name_plural": "round base review forms",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="roundsandlabs",
+ options={
+ "verbose_name": "round and lab",
+ "verbose_name_plural": "rounds and labs",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="sealedround",
+ options={
+ "verbose_name": "Sealed round",
+ "verbose_name_plural": "Sealed rounds",
+ },
+ ),
+ migrations.AlterModelOptions(
+ name="submissionexportmanager",
+ options={
+ "verbose_name": "submission export manager",
+ "verbose_name_plural": "submission export managers",
+ },
+ ),
+ ]
diff --git a/hypha/apply/funds/models/__init__.py b/hypha/apply/funds/models/__init__.py
index 8a4bba9e17..d610dc7979 100644
--- a/hypha/apply/funds/models/__init__.py
+++ b/hypha/apply/funds/models/__init__.py
@@ -37,6 +37,7 @@ class FundType(ApplicationBase):
class Meta:
verbose_name = _("Fund")
+ verbose_name_plural = _("Funds")
class RequestForPartners(ApplicationBase):
@@ -44,15 +45,24 @@ class RequestForPartners(ApplicationBase):
class Meta:
verbose_name = _("RFP")
+ verbose_name_plural = _("RFPs")
class Round(RoundBase):
parent_page_types = ["funds.FundType", "funds.RequestForPartners"]
+ class Meta:
+ verbose_name = _("Round")
+ verbose_name_plural = _("Rounds")
+
class SealedRound(RoundBase):
parent_page_types = ["funds.RequestForPartners"]
+ class Meta:
+ verbose_name = _("Sealed round")
+ verbose_name_plural = _("Sealed rounds")
+
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sealed = True
@@ -61,3 +71,4 @@ def __init__(self, *args, **kwargs):
class LabType(LabBase):
class Meta:
verbose_name = _("Lab")
+ verbose_name_plural = _("Labs")
diff --git a/hypha/apply/funds/models/application_revisions.py b/hypha/apply/funds/models/application_revisions.py
index 516f91eaed..03521d3004 100644
--- a/hypha/apply/funds/models/application_revisions.py
+++ b/hypha/apply/funds/models/application_revisions.py
@@ -1,6 +1,7 @@
from django.conf import settings
from django.db import models
from django.urls import reverse
+from django.utils.translation import gettext_lazy as _
from hypha.apply.stream_forms.files import StreamFieldDataEncoder
from hypha.apply.stream_forms.models import BaseStreamForm
@@ -27,6 +28,8 @@ class ApplicationRevision(BaseStreamForm, AccessFormData, models.Model):
class Meta:
ordering = ["-timestamp"]
+ verbose_name = _("application revision")
+ verbose_name_plural = _("application revisions")
def __str__(self):
return f"Revision for {self.submission.title_text_display} by {self.author} "
diff --git a/hypha/apply/funds/models/applications.py b/hypha/apply/funds/models/applications.py
index 83610cc04e..115fb9c508 100644
--- a/hypha/apply/funds/models/applications.py
+++ b/hypha/apply/funds/models/applications.py
@@ -28,6 +28,7 @@
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.functional import cached_property
+from django.utils.html import format_html, format_html_join
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from django_ratelimit.decorators import ratelimit
@@ -167,6 +168,10 @@ class ApplicationBase(EmailForm, WorkflowStreamForm, AsJsonMixin): # type: igno
parent_page_types = ["apply_home.ApplyHomePage"]
+ class Meta:
+ verbose_name = _("application base")
+ verbose_name_plural = _("application bases")
+
def get_template(self, request, *args, **kwargs):
# We want to force children to use our base template
# template attribute is ignored by children
@@ -344,6 +349,10 @@ def get_url(self, request: Optional[WSGIRequest] = None) -> Optional[str]:
]
)
+ class Meta:
+ verbose_name = _("round base")
+ verbose_name_plural = _("round bases")
+
def get_template(self, request, *args, **kwargs):
# Make sure all children use the shared template
return "funds/round.html"
@@ -423,7 +432,7 @@ def clean(self):
if self.start_date and self.end_date and self.start_date > self.end_date:
raise ValidationError(
{
- "end_date": "End date must come after the start date",
+ "end_date": _("End date must come after the start date"),
}
)
@@ -452,15 +461,21 @@ def clean(self):
conflicting_rounds = base_query.filter(conflict_query).exclude(id=self.id)
if conflicting_rounds.exists():
- error_message = mark_safe(
- "Overlaps with the following rounds:
{}".format(
- "
".join(
- [
- f'
{round.title}: {round.start_date} - {round.end_date}'
- for round in conflicting_rounds
- ]
- )
- )
+ error_message = format_html(
+ _("Overlaps with the following rounds:
{}"),
+ format_html_join(
+ sep=mark_safe("
"),
+ format_string='
{title}: {start_date} - {end_date}',
+ args_generator=[
+ {
+ "url": admin_url(round),
+ "title": round.title,
+ "start_date": round.start_date,
+ "end_date": round.end_date,
+ }
+ for round in conflicting_rounds
+ ],
+ ),
)
error = {
"start_date": error_message,
@@ -483,7 +498,7 @@ def get_initial_data_open_call_submission(self, submission_id):
title_block_id = submission.named_blocks.get("title")
if title_block_id:
field_data = submission.data(title_block_id)
- initial_values[title_block_id] = field_data + " (please edit)"
+ initial_values[title_block_id] = field_data + _(" (please edit)")
for field_id in submission.first_group_normal_text_blocks:
field_data = submission.data(field_id)
@@ -676,6 +691,10 @@ class LabBase(EmailForm, WorkflowStreamForm, SubmittableStreamForm, AsJsonMixin)
]
)
+ class Meta:
+ verbose_name = _("lab base")
+ verbose_name_plural = _("lab bases")
+
def get_submit_meta_data(self, **kwargs):
return super().get_submit_meta_data(
page=self,
@@ -850,6 +869,8 @@ class RoundsAndLabs(Page):
class Meta:
proxy = True
+ verbose_name = _("round and lab")
+ verbose_name_plural = _("rounds and labs")
def __eq__(self, other):
# This is one way equality RoundAndLab == Round/Lab
@@ -881,7 +902,7 @@ class ApplicationSettings(BaseSiteSetting):
wagtail_reference_index_ignore = True
class Meta:
- verbose_name = "application settings"
+ verbose_name = _("application settings")
extra_text_round = RichTextField(blank=True)
extra_text_lab = RichTextField(blank=True)
@@ -892,6 +913,6 @@ class Meta:
FieldPanel("extra_text_round"),
FieldPanel("extra_text_lab"),
],
- "extra text on application landing page",
+ _("extra text on application landing page"),
),
]
diff --git a/hypha/apply/funds/models/assigned_reviewers.py b/hypha/apply/funds/models/assigned_reviewers.py
index 8dd0900d86..73bf42d4e9 100644
--- a/hypha/apply/funds/models/assigned_reviewers.py
+++ b/hypha/apply/funds/models/assigned_reviewers.py
@@ -2,6 +2,7 @@
from django.contrib.auth.models import Group
from django.db import models
from django.db.models import F, Q
+from django.utils.translation import gettext_lazy as _
from hypha.apply.review.options import AGREE, DISAGREE
@@ -179,6 +180,8 @@ class AssignedReviewers(models.Model):
class Meta:
unique_together = (("submission", "role"), ("submission", "reviewer"))
+ verbose_name = _("assigned reviewer")
+ verbose_name_plural = _("assigned reviewers")
def __hash__(self):
return hash(self.pk)
diff --git a/hypha/apply/funds/models/co_applicants.py b/hypha/apply/funds/models/co_applicants.py
index f2672b5443..007c3674de 100644
--- a/hypha/apply/funds/models/co_applicants.py
+++ b/hypha/apply/funds/models/co_applicants.py
@@ -53,6 +53,8 @@ class CoApplicantInvite(models.Model):
class Meta:
unique_together = ("submission", "invited_user_email")
+ verbose_name = _("co-applicant invite")
+ verbose_name_plural = _("co-applicant invites")
def __str__(self):
return f"{self.invited_user_email} invited to {self.submission})"
@@ -78,6 +80,8 @@ class CoApplicant(models.Model):
class Meta:
unique_together = ("submission", "user")
+ verbose_name = _("co-applicant")
+ verbose_name_plural = _("co-applicants")
def __str__(self):
return self.user.get_display_name()
diff --git a/hypha/apply/funds/models/forms.py b/hypha/apply/funds/models/forms.py
index 721396c231..c392861c85 100644
--- a/hypha/apply/funds/models/forms.py
+++ b/hypha/apply/funds/models/forms.py
@@ -1,4 +1,5 @@
from django.db import models
+from django.utils.translation import gettext_lazy as _
from modelcluster.fields import ParentalKey
from wagtail.admin.panels import FieldPanel
from wagtail.fields import StreamField
@@ -20,6 +21,10 @@ class ApplicationForm(models.Model):
FieldPanel("form_fields"),
]
+ class Meta:
+ verbose_name = _("application form")
+ verbose_name_plural = _("applications forms")
+
def __str__(self):
return self.name
@@ -28,8 +33,8 @@ class AbstractRelatedForm(Orderable):
FIRST_STAGE = 1
SECOND_STAGE = 2
STAGE_CHOICES = [
- (FIRST_STAGE, "1st Stage"),
- (SECOND_STAGE, "2nd Stage"),
+ (FIRST_STAGE, _("1st Stage")),
+ (SECOND_STAGE, _("2nd Stage")),
]
form = models.ForeignKey("ApplicationForm", on_delete=models.PROTECT)
stage = models.PositiveSmallIntegerField(choices=STAGE_CHOICES)
@@ -68,14 +73,26 @@ def __str__(self):
class ApplicationBaseForm(AbstractRelatedForm):
application = ParentalKey("ApplicationBase", related_name="forms")
+ class Meta:
+ verbose_name = _("application base form")
+ verbose_name_plural = _("application base forms")
+
class RoundBaseForm(AbstractRelatedForm):
round = ParentalKey("RoundBase", related_name="forms")
+ class Meta:
+ verbose_name = _("round base form")
+ verbose_name_plural = _("round base forms")
+
class LabBaseForm(AbstractRelatedForm):
lab = ParentalKey("LabBase", related_name="forms")
+ class Meta:
+ verbose_name = _("lab base form")
+ verbose_name_plural = _("lab base forms")
+
class AbstractRelatedDeterminationForm(Orderable):
class Meta(Orderable.Meta):
@@ -158,38 +175,74 @@ def __str__(self):
class ApplicationBaseReviewForm(AbstractRelatedReviewForm):
application = ParentalKey("ApplicationBase", related_name="review_forms")
+ class Meta:
+ verbose_name = _("application base review form")
+ verbose_name_plural = _("application base review forms")
+
class ApplicationBaseExternalReviewForm(AbstractRelatedReviewForm):
application = ParentalKey("ApplicationBase", related_name="external_review_forms")
+ class Meta:
+ verbose_name = _("application base external review form")
+ verbose_name_plural = _("application base external review form")
+
class RoundBaseReviewForm(AbstractRelatedReviewForm):
round = ParentalKey("RoundBase", related_name="review_forms")
+ class Meta:
+ verbose_name = _("round base review form")
+ verbose_name_plural = _("round base review forms")
+
class RoundBaseExternalReviewForm(AbstractRelatedReviewForm):
round = ParentalKey("RoundBase", related_name="external_review_forms")
+ class Meta:
+ verbose_name = _("round base externa review form")
+ verbose_name_plural = _("round base external review forms")
+
class LabBaseReviewForm(AbstractRelatedReviewForm):
lab = ParentalKey("LabBase", related_name="review_forms")
+ class Meta:
+ verbose_name = _("lab base review form")
+ verbose_name_plural = _("lab base review forms")
+
class LabBaseExternalReviewForm(AbstractRelatedReviewForm):
lab = ParentalKey("LabBase", related_name="external_review_forms")
+ class Meta:
+ verbose_name = _("lab base external review form")
+ verbose_name_plural = _("lab base external review forms")
+
class ApplicationBaseDeterminationForm(AbstractRelatedDeterminationForm):
application = ParentalKey("ApplicationBase", related_name="determination_forms")
+ class Meta:
+ verbose_name = _("application base determination form")
+ verbose_name_plural = _("application base determination forms")
+
class RoundBaseDeterminationForm(AbstractRelatedDeterminationForm):
round = ParentalKey("RoundBase", related_name="determination_forms")
+ class Meta:
+ verbose_name = _("round base determination form")
+ verbose_name_plural = _("round base determination forms")
+
class LabBaseDeterminationForm(AbstractRelatedDeterminationForm):
lab = ParentalKey("LabBase", related_name="determination_forms")
+ class Meta:
+ verbose_name = _("lab base determination form")
+ verbose_name_plural = _("lab base determination forms")
+
class AbstractRelatedProjectForm(Orderable):
class Meta(Orderable.Meta):
@@ -258,18 +311,34 @@ def __str__(self):
class ApplicationBaseProjectForm(AbstractRelatedProjectForm):
application = ParentalKey("ApplicationBase", related_name="approval_forms")
+ class Meta:
+ verbose_name = _("application base project form")
+ verbose_name_plural = _("application base project forms")
+
class ApplicationBaseProjectSOWForm(AbstractRelatedProjectSOWForm):
application = ParentalKey("ApplicationBase", related_name="sow_forms")
+ class Meta:
+ verbose_name = _("application base project SOW form")
+ verbose_name_plural = _("application base project SOW forms")
+
class LabBaseProjectForm(AbstractRelatedProjectForm):
lab = ParentalKey("LabBase", related_name="approval_forms")
+ class Meta:
+ verbose_name = _("lab base project form")
+ verbose_name_plural = _("lab base project forms")
+
class LabBaseProjectSOWForm(AbstractRelatedProjectSOWForm):
lab = ParentalKey("LabBase", related_name="sow_forms")
+ class Meta:
+ verbose_name = _("lab base project SOW form")
+ verbose_name_plural = _("lab base project SOW forms")
+
class AbstractRelatedProjectReportForm(Orderable):
class Meta(Orderable.Meta):
@@ -303,6 +372,14 @@ def __str__(self):
class ApplicationBaseProjectReportForm(AbstractRelatedProjectReportForm):
application = ParentalKey("ApplicationBase", related_name="report_forms")
+ class Meta:
+ verbose_name = _("application base project report form")
+ verbose_name_plural = _("application base project report forms")
+
class LabBaseProjectReportForm(AbstractRelatedProjectReportForm):
lab = ParentalKey("LabBase", related_name="report_forms")
+
+ class Meta:
+ verbose_name = _("lab base project report form")
+ verbose_name_plural = _("lab base project report forms")
diff --git a/hypha/apply/funds/models/reminders.py b/hypha/apply/funds/models/reminders.py
index 44057f9802..11b10931c6 100644
--- a/hypha/apply/funds/models/reminders.py
+++ b/hypha/apply/funds/models/reminders.py
@@ -2,6 +2,8 @@
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
+from django.utils.translation import gettext
+from django.utils.translation import gettext_lazy as _
from hypha.apply.activity.messaging import MESSAGES
@@ -9,7 +11,7 @@
class Reminder(models.Model):
REVIEW = "reviewers_review"
ACTIONS = {
- REVIEW: "Remind reviewers to Review",
+ REVIEW: _("Remind reviewers to Review"),
}
EMAIL = "email"
MEDIUM = {REVIEW: EMAIL}
@@ -42,10 +44,12 @@ def __str__(self):
class Meta:
ordering = ["-time"]
+ verbose_name = _("reminder")
+ verbose_name_plural = _("reminders")
def clean(self):
if self.title == "":
- raise ValidationError("Title is Empty")
+ raise ValidationError(gettext("Title is Empty"))
@property
def is_expired(self):
diff --git a/hypha/apply/funds/models/reviewer_role.py b/hypha/apply/funds/models/reviewer_role.py
index 6cddf51e55..feb1733a06 100644
--- a/hypha/apply/funds/models/reviewer_role.py
+++ b/hypha/apply/funds/models/reviewer_role.py
@@ -27,6 +27,10 @@ class ReviewerRole(models.Model):
FieldPanel("order"),
]
+ class Meta:
+ verbose_name = _("reviewer role")
+ verbose_name_plural = _("reviewer roles")
+
def icon_url(self, filter_spec):
return generate_image_url(self.icon, filter_spec)
@@ -39,24 +43,24 @@ def __str__(self):
@register_setting
class ReviewerSettings(BaseSiteSetting):
SUBMISSIONS = [
- ("all", "All Submissions"),
- ("reviewed", "Only reviewed Submissions"),
+ ("all", _("All Submissions")),
+ ("reviewed", _("Only reviewed Submissions")),
]
STATES = [
- ("all", "All States"),
- ("ext_state_or_higher", "Only External review and higher"),
- ("ext_state_only", "Only External review"),
+ ("all", _("All States")),
+ ("ext_state_or_higher", _("Only External review and higher")),
+ ("ext_state_only", _("Only External review")),
]
OUTCOMES = [
- ("all", "All Outcomes"),
- ("all_except_dismissed", "All Outcomes Except Dismissed"),
- ("accepted", "Only Accepted"),
+ ("all", _("All Outcomes")),
+ ("all_except_dismissed", _("All Outcomes Except Dismissed")),
+ ("accepted", _("Only Accepted")),
]
class Meta:
- verbose_name = "Reviewer Settings"
+ verbose_name = _("Reviewer Settings")
submission = models.CharField(
choices=SUBMISSIONS,
diff --git a/hypha/apply/funds/models/screening.py b/hypha/apply/funds/models/screening.py
index 0abc0318e5..cc2138c1ad 100644
--- a/hypha/apply/funds/models/screening.py
+++ b/hypha/apply/funds/models/screening.py
@@ -20,8 +20,8 @@ class ScreeningStatus(models.Model):
base_form_class = ScreeningStatusAdminForm
class Meta:
- verbose_name = "Screening Decision"
- verbose_name_plural = "screening decisions"
+ verbose_name = _("Screening Decision")
+ verbose_name_plural = _("screening decisions")
def __str__(self):
return self.title
diff --git a/hypha/apply/funds/models/submissions.py b/hypha/apply/funds/models/submissions.py
index 01112ec0f2..ba35f5cc9b 100644
--- a/hypha/apply/funds/models/submissions.py
+++ b/hypha/apply/funds/models/submissions.py
@@ -536,6 +536,8 @@ class Meta:
indexes = [
GinIndex(fields=["search_document"]),
]
+ verbose_name = _("application submission")
+ verbose_name_plural = _("application submissions")
@property
def is_draft(self):
diff --git a/hypha/apply/funds/models/utils.py b/hypha/apply/funds/models/utils.py
index 8a17c45a5a..73d8d30817 100644
--- a/hypha/apply/funds/models/utils.py
+++ b/hypha/apply/funds/models/utils.py
@@ -151,7 +151,7 @@ def render_landing_page(self, request, form_submission=None, *args, **kwargs):
"external_review_forms",
label=_("External Review Forms"),
max_num=1,
- help_text="Add a form to be used by external reviewers.",
+ help_text=_("Add a form to be used by external reviewers."),
),
InlinePanel("determination_forms", label=_("Determination Forms")),
]
@@ -233,6 +233,10 @@ class SubmissionExportManager(models.Model):
total_export = models.IntegerField(null=True)
+ class Meta:
+ verbose_name = _("submission export manager")
+ verbose_name_plural = _("submission export managers")
+
def set_completed_and_save(self) -> None:
"""Sets the status to completed and saves the object"""
self.status = "success"
diff --git a/hypha/apply/funds/permissions.py b/hypha/apply/funds/permissions.py
index 06290b5cac..2b318e5762 100644
--- a/hypha/apply/funds/permissions.py
+++ b/hypha/apply/funds/permissions.py
@@ -1,5 +1,6 @@
from django.conf import settings
from django.core.exceptions import PermissionDenied
+from django.utils.translation import gettext as _
from rolepermissions.permissions import register_object_checker
from hypha.apply.funds.models.co_applicants import CoApplicant, CoApplicantRole
@@ -20,20 +21,20 @@ def has_permission(action, user, object=None, raise_exception=True):
def can_take_submission_actions(user, submission):
if not user.is_authenticated:
- return False, "Login Required"
+ return False, _("Login Required")
if submission.is_archive:
- return False, "Archived Submission"
+ return False, _("Archived Submission")
return True, ""
def can_edit_submission(user, submission):
if not user.is_authenticated:
- return False, "Login Required"
+ return False, _("Login Required")
if submission.is_archive:
- return False, "Archived Submission"
+ return False, _("Archived Submission")
if submission.phase.permissions.can_edit(user):
co_applicant = submission.co_applicants.filter(user=user).first()
@@ -41,10 +42,12 @@ def can_edit_submission(user, submission):
if co_applicant.role not in [CoApplicantRole.VIEW, CoApplicantRole.COMMENT]:
return (
True,
- "Co-applicant with read/view only or comment access can't edit submission",
+ _(
+ "Co-applicant with read/view only or comment access can't edit submission"
+ ),
)
return False, ""
- return True, "User can edit in current phase"
+ return True, _("User can edit in current phase")
return False, ""
@@ -149,10 +152,10 @@ def can_alter_archived_submissions(user, submission=None) -> (bool, str):
archive_access_groups = get_archive_alter_groups()
if user.is_apply_staff and STAFF_GROUP_NAME in archive_access_groups:
- return True, "Staff is set to alter archive"
+ return True, _("Staff is set to alter archive")
if user.is_apply_staff_admin and TEAMADMIN_GROUP_NAME in archive_access_groups:
- return True, "Staff Admin is set to alter archive"
- return False, "Forbidden Error"
+ return True, _("Staff Admin is set to alter archive")
+ return False, _("Forbidden Error")
def can_bulk_archive_submissions(user) -> bool:
@@ -204,10 +207,10 @@ def can_export_submissions(user) -> bool:
def is_user_has_access_to_view_submission(user, submission):
if not user.is_authenticated:
- return False, "Login Required"
+ return False, _("Login Required")
if submission.is_archive and not can_view_archived_submissions(user):
- return False, "Archived Submission"
+ return False, _("Archived Submission")
if (
user.is_apply_staff
@@ -227,57 +230,58 @@ def is_user_has_access_to_view_submission(user, submission):
def can_view_submission_screening(user, submission):
- submission_view, _ = is_user_has_access_to_view_submission(user, submission)
+ # __ to avoid shadowing the gettext alias
+ submission_view, __ = is_user_has_access_to_view_submission(user, submission)
if not submission_view:
- return False, "No access to view submission"
+ return False, _("No access to view submission")
if submission.user == user:
- return False, "Applicant cannot view submission screening"
+ return False, _("Applicant cannot view submission screening")
return True, ""
def can_invite_co_applicants(user, submission):
if submission.is_archive:
- return False, "Co-applicant can't be added to archived submission"
+ return False, _("Co-applicant can't be added to archived submission")
if hasattr(submission, "project"):
from hypha.apply.projects.models.project import COMPLETE
if submission.project.status == COMPLETE:
- return False, "Co-applicants can't be invited to completed projects"
+ return False, _("Co-applicants can't be invited to completed projects")
if (
submission.co_applicant_invites.all().count()
>= settings.SUBMISSIONS_COAPPLICANT_INVITES_LIMIT
):
- return False, "Limit reached for this submission"
+ return False, _("Limit reached for this submission")
if user.is_applicant and user == submission.user:
- return True, "Applicants can invite co-applicants to their application"
+ return True, _("Applicants can invite co-applicants to their application")
if user.is_apply_staff:
- return True, "Staff can invite co-applicant on behalf of applicant"
- return False, "Forbidden Error"
+ return True, _("Staff can invite co-applicant on behalf of applicant")
+ return False, _("Forbidden Error")
def can_view_co_applicants(user, submission):
if user.is_applicant and user == submission.user:
- return True, "Submission user can access their submission's co-applicants"
+ return True, _("Submission user can access their submission's co-applicants")
if user.is_apply_staff:
- return True, "Staff can access each submissions' co-applicants"
- return False, "Forbidden Error"
+ return True, _("Staff can access each submissions' co-applicants")
+ return False, _("Forbidden Error")
def can_update_co_applicant(user, invite):
if invite.submission.is_archive:
- return False, "Co-applicant can't be updated to archived submission"
+ return False, _("Co-applicant can't be updated to archived submission")
if hasattr(invite.submission, "project"):
from hypha.apply.projects.models.project import COMPLETE
if invite.submission.project.status == COMPLETE:
- return False, "Co-applicants can't be updated to completed projects"
+ return False, _("Co-applicants can't be updated to completed projects")
if invite.invited_by == user:
- return True, "Same user who invited can delete the co-applicant"
+ return True, _("Same user who invited can delete the co-applicant")
if invite.submission.user == user:
- return True, "Submission owner can delete the co-applicant"
+ return True, _("Submission owner can delete the co-applicant")
if user.is_apply_staff:
- return True, "Staff can delete any co-applicant of any submission"
- return False, "Forbidden Error"
+ return True, _("Staff can delete any co-applicant of any submission")
+ return False, _("Forbidden Error")
def user_can_view_post_comment_form(user, submission):
diff --git a/hypha/apply/funds/services.py b/hypha/apply/funds/services.py
index 0e23ffbeff..358805d690 100644
--- a/hypha/apply/funds/services.py
+++ b/hypha/apply/funds/services.py
@@ -16,6 +16,7 @@
from django.db.models.functions import Coalesce
from django.http import HttpRequest
from django.utils.translation import gettext as _
+from django.utils.translation import ngettext
from hypha.apply.activity.messaging import MESSAGES, messenger
from hypha.apply.activity.models import Activity, Event
@@ -41,7 +42,10 @@ def bulk_archive_submissions(
submissions.update(is_archive=True)
messages.success(
- request, _("{number} submissions archived.").format(number=len(submissions))
+ request,
+ ngettext(
+ "{} submission archived.", "{} submissions archived.", len(submissions)
+ ).format(len(submissions)),
)
messenger(
@@ -73,7 +77,10 @@ def bulk_delete_submissions(
).delete()
messages.success(
- request, _("{number} submissions deleted.").format(number=len(submissions))
+ request,
+ ngettext(
+ "{} submission deleted.", "{} submissions deleted.", len(submissions)
+ ).format(len(submissions)),
)
messenger(
diff --git a/hypha/apply/funds/tables.py b/hypha/apply/funds/tables.py
index bef7d1a0c0..550ccc26b2 100644
--- a/hypha/apply/funds/tables.py
+++ b/hypha/apply/funds/tables.py
@@ -150,7 +150,7 @@ class BaseAdminSubmissionsTable(SubmissionsTable):
reviews_stats = tables.TemplateColumn(
template_name="funds/tables/column_reviews.html",
verbose_name=mark_safe(
- 'Reviews
Comp. / Assgn.
'
+ _('Reviews
Comp. / Assgn.
')
),
orderable=False,
)
@@ -435,7 +435,7 @@ def __init__(self, *args, **kwargs):
super().__init__(
self,
*args,
- choices=[("active", "Active"), ("inactive", "Inactive")],
+ choices=[("active", _("Active")), ("inactive", _("Inactive"))],
**kwargs,
)
@@ -455,7 +455,11 @@ def __init__(self, *args, **kwargs):
super().__init__(
self,
*args,
- choices=[("open", "Open"), ("closed", "Closed"), ("new", "Not Started")],
+ choices=[
+ ("open", _("Open")),
+ ("closed", _("Closed")),
+ ("new", _("Not Started")),
+ ],
**kwargs,
)
diff --git a/hypha/apply/funds/templates/cotton/submission_list.html b/hypha/apply/funds/templates/cotton/submission_list.html
index c3e42c7deb..f3612eb082 100644
--- a/hypha/apply/funds/templates/cotton/submission_list.html
+++ b/hypha/apply/funds/templates/cotton/submission_list.html
@@ -1,4 +1,4 @@
-{% load querystrings heroicons %}
+{% load querystrings heroicons i18n %}
@@ -17,25 +17,25 @@
{% if enable_selection %}
| {% endif %}
|
- Title
+ {% trans 'Title' %}
|
-
Status |
+
{% trans 'Status' %} |
- Applicant
+ {% trans 'Applicant' %}
{% if 'organization_name' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
- / Organization
+ / {% trans 'Organization' %}
{% endif %}
|
{% if "round" not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
-
Round |
+
{% trans 'Round' %} |
{% endif %}
{% if 'lead' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}
-
Lead |
+
{% trans 'Lead' %} |
{% endif %}
- {% if 'reviews' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}Reviews /{% endif %} Comments
+ {% if 'reviews' not in SUBMISSIONS_TABLE_EXCLUDED_FIELDS %}{% trans 'Reviews' %} /{% endif %} {% trans 'Comments' %}
|
@@ -54,6 +54,6 @@
{% endif %}
diff --git a/hypha/apply/funds/templates/funds/admin/parent_chooser.html b/hypha/apply/funds/templates/funds/admin/parent_chooser.html
index 3b30146b74..f59a9f1ad4 100644
--- a/hypha/apply/funds/templates/funds/admin/parent_chooser.html
+++ b/hypha/apply/funds/templates/funds/admin/parent_chooser.html
@@ -15,7 +15,12 @@
-
\ No newline at end of file
+
diff --git a/hypha/apply/funds/templates/funds/includes/screening_status_block-button.html b/hypha/apply/funds/templates/funds/includes/screening_status_block-button.html
index 6399b3c8af..c24a3f94fc 100644
--- a/hypha/apply/funds/templates/funds/includes/screening_status_block-button.html
+++ b/hypha/apply/funds/templates/funds/includes/screening_status_block-button.html
@@ -31,10 +31,10 @@
{% endif %}
{% if current_status %}
- hx-confirm='Are you sure you want to remove the "{{ current_status }}" screening decision?'
- data-tippy-content="Remove"
+ hx-confirm='{% blocktrans %}Are you sure you want to remove the "{{ current_status }}" screening decision?{% endblocktrans %}'
+ data-tippy-content="{% trans 'Remove' %}"
{% else %}
- data-tippy-content="Mark as {{ default_status }}"
+ data-tippy-content="{% blocktrans %}Mark as {{ default_status }}{% endblocktrans %}"
{% endif %}
>
{% if type == "yes" %}
@@ -67,7 +67,7 @@
@keydown.up.prevent="$focus.wrap().previous()"
>