Make ClubRole.name translatable

This commit is contained in:
imperosol committed 2026-11-14 14:10:13 +01:00
1 parent aab5cc178e
commit 884940af30
8 files changed
+167 -23

No files matched your search

+15 -2
View File
@@ -302,12 +302,22 @@ class ClubRoleForm(forms.ModelForm):
class Meta:
model = ClubRole
fields = ["name", "description", "is_presidency", "is_board", "is_active"]
fields = [
"name",
"name_en",
"description",
"is_presidency",
"is_board",
"is_active",
]
widgets = {
"is_presidency": forms.HiddenInput(),
"is_board": forms.HiddenInput(),
"is_active": forms.CheckboxInput(attrs={"class": "switch"}),
}
help_texts = {
"name_en": _("Provide an english name for non-french speaking users.")
}
def clean(self):
cleaned_data = super().clean()
@@ -354,7 +364,10 @@ class ClubRoleCreateForm(forms.ModelForm):
class Meta:
model = ClubRole
fields = ["name", "description"]
fields = ["name", "name_en", "description"]
help_texts = {
"name_en": _("Provide an english name for non-french speaking users.")
}
def __init__(
self, *args, club: Club, is_presidency: bool, is_board: bool, **kwargs