mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-24 17:10:31 +00:00
Translates invite form values
This commit is contained in:
parent
c1e117a9f6
commit
8bb7d5bba0
1 changed files with 8 additions and 6 deletions
|
@ -6,6 +6,7 @@ from django import forms
|
||||||
from django.forms import ModelForm, PasswordInput, widgets
|
from django.forms import ModelForm, PasswordInput, widgets
|
||||||
from django.forms.widgets import Textarea
|
from django.forms.widgets import Textarea
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
from django.utils.translation import gettext as _
|
||||||
|
|
||||||
from bookwyrm import models
|
from bookwyrm import models
|
||||||
|
|
||||||
|
@ -181,13 +182,14 @@ class CreateInviteForm(CustomForm):
|
||||||
exclude = ['code', 'user', 'times_used']
|
exclude = ['code', 'user', 'times_used']
|
||||||
widgets = {
|
widgets = {
|
||||||
'expiry': ExpiryWidget(choices=[
|
'expiry': ExpiryWidget(choices=[
|
||||||
('day', 'One Day'),
|
('day', _('One Day')),
|
||||||
('week', 'One Week'),
|
('week', _('One Week')),
|
||||||
('month', 'One Month'),
|
('month', _('One Month')),
|
||||||
('forever', 'Does Not Expire')]),
|
('forever', _('Does Not Expire'))]),
|
||||||
'use_limit': widgets.Select(
|
'use_limit': widgets.Select(
|
||||||
choices=[(i, "%d uses" % (i,)) for i in [1, 5, 10, 25, 50, 100]]
|
choices=[(i, _("%(count)d uses" % {'count': i})) \
|
||||||
+ [(None, 'Unlimited')])
|
for i in [1, 5, 10, 25, 50, 100]]
|
||||||
|
+ [(None, _('Unlimited'))])
|
||||||
}
|
}
|
||||||
|
|
||||||
class ShelfForm(CustomForm):
|
class ShelfForm(CustomForm):
|
||||||
|
|
Loading…
Reference in a new issue