From dbec07d1494a4b669c06766802386d52b91223f2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 4 Jan 2024 09:50:51 +0100 Subject: [PATCH 1/3] Fix translation of AnnouncementForm Form translation things must use lazy_gettext aka _l --- snikket_web/admin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snikket_web/admin.py b/snikket_web/admin.py index 64f8efd..c2b27c0 100644 --- a/snikket_web/admin.py +++ b/snikket_web/admin.py @@ -733,21 +733,21 @@ def get_system_stats() -> typing.MutableMapping[ class AnnouncementForm(BaseForm): text = wtforms.StringField( - _("Message contents"), + _l("Message contents"), widget=wtforms.widgets.TextArea(), validators=[wtforms.validators.DataRequired()], ) online_only = wtforms.BooleanField( - _("Only send to online users"), + _l("Only send to online users"), ) action_post_all = wtforms.SubmitField( - _("Post to all users"), + _l("Post to all users"), ) action_send_preview = wtforms.SubmitField( - _("Send preview to yourself"), + _l("Send preview to yourself"), ) From 17d586e38461ea70529b8af24cb1aa89b4e88b2e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 4 Jan 2024 09:52:02 +0100 Subject: [PATCH 2/3] Fix translation of "Limited" Strings in Forms must use lazy_gettext aka _l --- snikket_web/admin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snikket_web/admin.py b/snikket_web/admin.py index c2b27c0..24e6cde 100644 --- a/snikket_web/admin.py +++ b/snikket_web/admin.py @@ -76,7 +76,7 @@ class EditUserForm(BaseForm): role = wtforms.RadioField( _l("Access Level"), choices=[ - ("prosody:restricted", _("Limited")), + ("prosody:restricted", _l("Limited")), ("prosody:registered", _l("Normal user")), ("prosody:admin", _l("Administrator")), ], From ddfdd2fd55f4b81305e2a4f90e0b9e465fa86d19 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 4 Jan 2024 09:52:44 +0100 Subject: [PATCH 3/3] Remove stray HTML closing tag Where is the
??? --- snikket_web/templates/admin_users.html | 1 - 1 file changed, 1 deletion(-) diff --git a/snikket_web/templates/admin_users.html b/snikket_web/templates/admin_users.html index 3ad15de..9989e61 100644 --- a/snikket_web/templates/admin_users.html +++ b/snikket_web/templates/admin_users.html @@ -27,7 +27,6 @@ {%- call action_button("edit", url_for(".edit_user", localpart=user.localpart), class="primary") -%} {% trans user_name=user.localpart %}Edit user {{ user_name }}{% endtrans %} {%- endcall -%} -
{% endfor %}