kopia lustrzana https://github.com/wagtail/wagtail
Adds missing i18n & avoids an heretic non-method class function.
rodzic
44476de07e
commit
03d361b055
|
|
@ -385,10 +385,15 @@ class NotificationPreferencesForm(forms.ModelForm):
|
|||
fields = ("submitted_notifications", "approved_notifications", "rejected_notifications")
|
||||
|
||||
|
||||
def _get_language_choices():
|
||||
return sorted(BLANK_CHOICE_DASH + get_available_admin_languages(),
|
||||
key=lambda l: l[1])
|
||||
|
||||
|
||||
class PreferredLanguageForm(forms.ModelForm):
|
||||
preferred_language = forms.ChoiceField(
|
||||
required=False,
|
||||
choices=lambda: sorted(BLANK_CHOICE_DASH + get_available_admin_languages(), key=lambda l: l[1])
|
||||
required=False, choices=_get_language_choices,
|
||||
label=_('Preferred language')
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
|
@ -401,19 +406,20 @@ class EmailForm(forms.ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ("email", )
|
||||
fields = ("email",)
|
||||
|
||||
|
||||
def _get_time_zone_choices():
|
||||
time_zones = [(tz, str(l18n.tz_fullnames.get(tz, tz)))
|
||||
for tz in get_available_admin_time_zones()]
|
||||
time_zones.sort(key=itemgetter(1))
|
||||
return BLANK_CHOICE_DASH + time_zones
|
||||
|
||||
|
||||
class CurrentTimeZoneForm(forms.ModelForm):
|
||||
def _get_time_zone_choices():
|
||||
time_zones = [(tz, str(l18n.tz_fullnames.get(tz, tz)))
|
||||
for tz in get_available_admin_time_zones()]
|
||||
time_zones.sort(key=itemgetter(1))
|
||||
return BLANK_CHOICE_DASH + time_zones
|
||||
|
||||
current_time_zone = forms.ChoiceField(
|
||||
required=False,
|
||||
choices=_get_time_zone_choices
|
||||
required=False, choices=_get_time_zone_choices,
|
||||
label=_('Current time zone')
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue