Browse Source

Remove debug line; Fix gettext

pull/38/head
Dashie der otter 4 weeks ago
parent
commit
3305b8ee8e
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
2 changed files with 5 additions and 6 deletions
  1. 0
    1
      app.py
  2. 5
    5
      forms.py

+ 0
- 1
app.py View File

@@ -156,7 +156,6 @@ def create_app(config_filename="config.py", app_name=None, register_blueprints=T
156 156
         # otherwise try to guess the language from the user accept
157 157
         # header the browser transmits.  We support fr/en in this
158 158
         # example.  The best match wins.
159
-        print(f"Best locale choosed: {request.accept_languages.best_match(AVAILABLE_LOCALES)}")
160 159
         return request.accept_languages.best_match(AVAILABLE_LOCALES)
161 160
 
162 161
     @babel.timezoneselector

+ 5
- 5
forms.py View File

@@ -84,9 +84,9 @@ def get_licences():
84 84
 
85 85
 
86 86
 class SoundUploadForm(Form):
87
-    title = StringField(gettext("Title"), [Length(max=255)])
88
-    description = TextAreaField(gettext("Description"))
89
-    sound = FileField(gettext("File"), [FileRequired(), FileAllowed(AUDIO)])
87
+    title = StringField(lazy_gettext("Title"), [Length(max=255)])
88
+    description = TextAreaField(lazy_gettext("Description"))
89
+    sound = FileField(lazy_gettext("File"), [FileRequired(), FileAllowed(AUDIO)])
90 90
     album = QuerySelectField(
91 91
         query_factory=get_albums,
92 92
         allow_blank=True,
@@ -119,9 +119,9 @@ class SoundEditForm(Form):
119 119
 
120 120
     def validate_private(form, field):
121 121
         if field.data is True and form.album.data.private is False:
122
-            raise ValidationError(gettext("Cannot put private sound in public album"))
122
+            raise ValidationError(lazy_gettext("Cannot put private sound in public album"))
123 123
         if field.data is True and form.sound.data.private is False:
124
-            raise ValidationError(gettext("Published sound cannot be privatized again"))
124
+            raise ValidationError(lazy_gettext("Published sound cannot be privatized again"))
125 125
 
126 126
     submit = SubmitField(lazy_gettext("Edit sound"))
127 127
 

Loading…
Cancel
Save