From a110c70b6f2162d54650943bcd294ad2a8d1dc43 Mon Sep 17 00:00:00 2001 From: Fioddor Superconcentrado Date: Wed, 18 Nov 2020 14:24:56 +0100 Subject: [PATCH] bepasty: Apply translation to autogenerated comments. Helps: #1938 Signed-off-by: Fioddor Superconcentrado Reviewed-by: James Valleroy --- plinth/locale/django.pot | 48 ++++++++++++------- plinth/modules/bepasty/templates/bepasty.html | 2 +- plinth/modules/bepasty/views.py | 8 ++++ 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/plinth/locale/django.pot b/plinth/locale/django.pot index b310e2a95..c332e0274 100644 --- a/plinth/locale/django.pot +++ b/plinth/locale/django.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-16 19:46-0500\n" +"POT-Creation-Date: 2020-11-18 12:49+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -691,19 +691,36 @@ msgstr "" msgid "Password" msgstr "" -#: plinth/modules/bepasty/views.py:42 +#: plinth/modules/bepasty/templates/bepasty.html:41 +#, python-format +msgid "%(comment)s" +msgstr "" + +#: plinth/modules/bepasty/views.py:22 +msgid "admin" +msgstr "" + +#: plinth/modules/bepasty/views.py:23 +msgid "editor" +msgstr "" + +#: plinth/modules/bepasty/views.py:24 +msgid "viewer" +msgstr "" + +#: plinth/modules/bepasty/views.py:48 msgid "Read" msgstr "" -#: plinth/modules/bepasty/views.py:43 +#: plinth/modules/bepasty/views.py:49 msgid "Create" msgstr "" -#: plinth/modules/bepasty/views.py:44 +#: plinth/modules/bepasty/views.py:50 msgid "List" msgstr "" -#: plinth/modules/bepasty/views.py:45 +#: plinth/modules/bepasty/views.py:51 #: plinth/modules/letsencrypt/templates/letsencrypt.html:91 #: plinth/modules/networks/templates/connection_show.html:48 #: plinth/modules/samba/templates/samba.html:127 @@ -714,31 +731,31 @@ msgstr "" msgid "Delete" msgstr "" -#: plinth/modules/bepasty/views.py:46 +#: plinth/modules/bepasty/views.py:52 msgid "Admin" msgstr "" -#: plinth/modules/bepasty/views.py:83 plinth/modules/searx/views.py:38 +#: plinth/modules/bepasty/views.py:89 plinth/modules/searx/views.py:38 #: plinth/modules/searx/views.py:49 plinth/modules/tor/views.py:130 #: plinth/modules/tor/views.py:157 msgid "Configuration updated." msgstr "" -#: plinth/modules/bepasty/views.py:86 plinth/modules/gitweb/views.py:117 +#: plinth/modules/bepasty/views.py:92 plinth/modules/gitweb/views.py:117 #: plinth/modules/searx/views.py:41 plinth/modules/searx/views.py:52 #: plinth/modules/tor/views.py:159 msgid "An error occurred during configuration." msgstr "" -#: plinth/modules/bepasty/views.py:97 +#: plinth/modules/bepasty/views.py:103 msgid "Password added." msgstr "" -#: plinth/modules/bepasty/views.py:102 +#: plinth/modules/bepasty/views.py:108 msgid "Add Password" msgstr "" -#: plinth/modules/bepasty/views.py:119 +#: plinth/modules/bepasty/views.py:125 msgid "Password deleted." msgstr "" @@ -3712,8 +3729,10 @@ msgid "Wi-Fi" msgstr "" #: plinth/modules/networks/templates/connections_diagram.html:74 +#: plinth/modules/networks/templates/connections_diagram.html:104 +#: plinth/modules/networks/templates/connections_list.html:62 #, python-format -msgid "Show connection %(connection.name)s" +msgid "Show connection %(name)s" msgstr "" #: plinth/modules/networks/templates/connections_diagram.html:92 @@ -3721,11 +3740,6 @@ msgstr "" msgid "Internal" msgstr "" -#: plinth/modules/networks/templates/connections_diagram.html:104 -#, python-format -msgid "Show connection %(name)s" -msgstr "" - #: plinth/modules/networks/templates/connections_diagram.html:116 msgid "Computer" msgstr "" diff --git a/plinth/modules/bepasty/templates/bepasty.html b/plinth/modules/bepasty/templates/bepasty.html index 28cab6fff..f6965f475 100644 --- a/plinth/modules/bepasty/templates/bepasty.html +++ b/plinth/modules/bepasty/templates/bepasty.html @@ -38,7 +38,7 @@ {{ password.password }} {{ password.permissions }} - {{ password.comment }} + {% trans password.comment %}
diff --git a/plinth/modules/bepasty/views.py b/plinth/modules/bepasty/views.py index e0bf68192..a9ab1ba7e 100644 --- a/plinth/modules/bepasty/views.py +++ b/plinth/modules/bepasty/views.py @@ -18,6 +18,14 @@ from plinth.views import AppView from .forms import AddPasswordForm, SetDefaultPermissionsForm +# i18n for permission comments +PERMISSION_COMMENTS_STRINGS = { + 'admin': _('admin'), + 'editor': _('editor'), + 'viewer': _('viewer'), +} + + class BepastyView(AppView): """Serve configuration page.""" app_id = 'bepasty'