From 6c7041c87529b532c6f08791c9b82df75968d9d6 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 27 Mar 2025 12:09:04 +0100 Subject: [PATCH] Add a label for empty salutation option (Z#23183319) (#4913) --- src/pretix/base/forms/questions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pretix/base/forms/questions.py b/src/pretix/base/forms/questions.py index f223ee952..774060c9f 100644 --- a/src/pretix/base/forms/questions.py +++ b/src/pretix/base/forms/questions.py @@ -127,7 +127,13 @@ class NamePartsWidget(forms.MultiWidget): if fname == 'title' and self.titles: widgets.append(Select(attrs=a, choices=[('', '')] + [(d, d) for d in self.titles[1]])) elif fname == 'salutation': - widgets.append(Select(attrs=a, choices=[('', '---'), ('empty', '')] + PERSON_NAME_SALUTATIONS)) + widgets.append(Select( + attrs=a, + choices=[ + ('', '---'), + ('empty', '({})'.format(pgettext_lazy("name_salutation", "not specified"))), + ] + PERSON_NAME_SALUTATIONS + )) else: widgets.append(self.widget(attrs=a)) super().__init__(widgets, attrs) @@ -245,7 +251,10 @@ class NamePartsFormField(forms.MultiValueField): d.pop('validators', None) field = forms.ChoiceField( **d, - choices=[('', '---'), ('empty', '')] + PERSON_NAME_SALUTATIONS + choices=[ + ('', '---'), + ('empty', '({})'.format(pgettext_lazy("name_salutation", "not specified"))), + ] + PERSON_NAME_SALUTATIONS ) else: field = forms.CharField(**defaults)