Merge pull request #172 from Zash/form-translation-fix

Fix incomplete translation of Announcement form and Limited user role
This commit is contained in:
Matthew Wild
2024-01-04 09:05:33 +00:00
committed by GitHub
2 changed files with 5 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ class EditUserForm(BaseForm):
role = wtforms.RadioField( role = wtforms.RadioField(
_l("Access Level"), _l("Access Level"),
choices=[ choices=[
("prosody:restricted", _("Limited")), ("prosody:restricted", _l("Limited")),
("prosody:registered", _l("Normal user")), ("prosody:registered", _l("Normal user")),
("prosody:admin", _l("Administrator")), ("prosody:admin", _l("Administrator")),
], ],
@@ -733,21 +733,21 @@ def get_system_stats() -> typing.MutableMapping[
class AnnouncementForm(BaseForm): class AnnouncementForm(BaseForm):
text = wtforms.StringField( text = wtforms.StringField(
_("Message contents"), _l("Message contents"),
widget=wtforms.widgets.TextArea(), widget=wtforms.widgets.TextArea(),
validators=[wtforms.validators.DataRequired()], validators=[wtforms.validators.DataRequired()],
) )
online_only = wtforms.BooleanField( online_only = wtforms.BooleanField(
_("Only send to online users"), _l("Only send to online users"),
) )
action_post_all = wtforms.SubmitField( action_post_all = wtforms.SubmitField(
_("Post to all users"), _l("Post to all users"),
) )
action_send_preview = wtforms.SubmitField( action_send_preview = wtforms.SubmitField(
_("Send preview to yourself"), _l("Send preview to yourself"),
) )

View File

@@ -27,7 +27,6 @@
{%- call action_button("edit", url_for(".edit_user", localpart=user.localpart), class="primary") -%} {%- call action_button("edit", url_for(".edit_user", localpart=user.localpart), class="primary") -%}
{% trans user_name=user.localpart %}Edit user {{ user_name }}{% endtrans %} {% trans user_name=user.localpart %}Edit user {{ user_name }}{% endtrans %}
{%- endcall -%} {%- endcall -%}
</form>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}