From 0400e85f89d7b81a42b234ed6ab9e061919a71d7 Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Fri, 1 May 2020 21:40:43 +0200 Subject: [PATCH] fontawesome5;interfont;local frontend resources;languages --- .gitignore | 4 + Dockerfile | 17 +++ bootstrap_variables.scss | 6 + locale/de/LC_MESSAGES/django.po | 132 ++++++++-------- locale/en/LC_MESSAGES/django.po | 141 +++++++++--------- portier/settings.py | 14 +- portier/urls.py | 1 + requirements.txt | 2 +- .../restreamconfig_confirm_delete.html | 4 +- .../restream/restreamconfig_detail.html | 6 +- .../restream/restreamconfig_list.html | 29 ++-- .../templates/rtmp/stream_confirm_delete.html | 4 +- rtmp/templates/rtmp/stream_detail.html | 14 +- rtmp/templates/rtmp/stream_list.html | 30 ++-- static/css/bootstrap.min.css | 1 + static/js/bootstrap.bundle.min.js | 7 + templates/base.html | 55 +++++-- templates/registration/login.html | 1 + .../registration/password_change_done.html | 1 + .../registration/password_change_form.html | 1 + .../registration/password_reset_form.html | 1 + 21 files changed, 288 insertions(+), 183 deletions(-) create mode 100644 bootstrap_variables.scss create mode 100644 static/css/bootstrap.min.css create mode 100644 static/js/bootstrap.bundle.min.js diff --git a/.gitignore b/.gitignore index 5ac8951..aa9a7b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ .env +static/css/font-awesome.min.css +static/js/bootstrap.bundle.min.js +static/js/jquery.min.js +static/fonts # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/Dockerfile b/Dockerfile index 1901d6a..1f250c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,11 @@ WORKDIR /app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 +# https://github.com/twbs/bootstrap/issues/30553 don't upgrade jquery to 3.5.0 yet +ENV JQUERY_VERSION=3.4.1 +ENV BOOTSTRAP_VERSION=4.4.1 +ENV INTER_VERSION=3.13 + # install required packages RUN apk add --no-cache postgresql-dev gcc python3-dev musl-dev gettext postgresql-client nginx supervisor @@ -21,6 +26,18 @@ RUN addgroup -S portier && adduser -S portier -G portier # add code ADD --chown=portier:portier . /app + +# add static external libraries for frontend +ADD --chown=portier:portier http://code.jquery.com/jquery-${JQUERY_VERSION}.min.js /app/static/js/jquery.min.js +ADD --chown=portier:portier https://stackpath.bootstrapcdn.com/bootstrap/${BOOTSTRAP_VERSION}/js/bootstrap.bundle.min.js /app/static/js/bootstrap.bundle.min.js +RUN mkdir -p /tmp/inter /app/static/fonts \ + && cd /tmp/inter && wget https://github.com/rsms/inter/releases/download/v${INTER_VERSION}/Inter-${INTER_VERSION}.zip \ + && unzip Inter-${INTER_VERSION}.zip && mv /tmp/inter/Inter\ Web/* /app/static/fonts/ \ + && cd - \ + && rm -rf /tmp/inter \ + && chown -R portier:portier /app/static/fonts/ + +# collect static files and compile localized strings RUN ./manage.py collectstatic --noinput --link RUN ./manage.py compilemessages diff --git a/bootstrap_variables.scss b/bootstrap_variables.scss new file mode 100644 index 0000000..c398f16 --- /dev/null +++ b/bootstrap_variables.scss @@ -0,0 +1,6 @@ + +$primary: rgb(17, 114, 26); +$font-family-sans-serif: Inter,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +$enable-shadows: true; +$enable-responsive-font-sizes: true; +$enable-rounded: false; \ No newline at end of file diff --git a/locale/de/LC_MESSAGES/django.po b/locale/de/LC_MESSAGES/django.po index cf015c4..f6e18f0 100644 --- a/locale/de/LC_MESSAGES/django.po +++ b/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-01 12:17+0000\n" +"POT-Creation-Date: 2020-05-01 17:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,6 +18,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: portier/settings.py:139 +msgid "German" +msgstr "Deutsch" + +#: portier/settings.py:140 +msgid "English" +msgstr "Englisch" + #: restream/models.py:11 msgid "restreamconfig_stream_help" msgstr "" @@ -49,19 +57,20 @@ msgstr "" #: restream/templates/restream/restreamconfig_confirm_delete.html:6 #: rtmp/templates/rtmp/stream_confirm_delete.html:6 msgid "confirm_delete_header" -msgstr "" +msgstr "Löschen bestätigen" #: restream/templates/restream/restreamconfig_confirm_delete.html:12 #, python-format msgid "are_you_sure_you_want_to_delete_\"%(restreamconfig_config_name)s\"?" msgstr "" +"Bist du sicher, dass du \"%(restreamconfig_config_name)s\" löschen willst?" #: restream/templates/restream/restreamconfig_confirm_delete.html:15 #: restream/templates/restream/restreamconfig_detail.html:20 #: rtmp/templates/rtmp/stream_confirm_delete.html:18 #: rtmp/templates/rtmp/stream_detail.html:20 msgid "delete" -msgstr "" +msgstr "Löschen" #: restream/templates/restream/restreamconfig_detail.html:12 msgid "restreamconfig_configuration_details_header" @@ -70,26 +79,26 @@ msgstr "" #: restream/templates/restream/restreamconfig_detail.html:17 #: rtmp/templates/rtmp/stream_detail.html:17 msgid "change" -msgstr "" +msgstr "Ändern" #: restream/templates/restream/restreamconfig_detail.html:28 #: restream/templates/restream/restreamconfig_list.html:18 #: rtmp/templates/rtmp/stream_detail.html:28 #: rtmp/templates/rtmp/stream_list.html:18 msgid "name" -msgstr "" +msgstr "Name" #: restream/templates/restream/restreamconfig_detail.html:30 msgid "stream" -msgstr "" +msgstr "Stream" #: restream/templates/restream/restreamconfig_detail.html:35 msgid "configured_target_url" -msgstr "" +msgstr "Konfigurierte Ziel-URL" #: restream/templates/restream/restreamconfig_form.html:5 msgid "create_new_restreamconfig_configuration_header" -msgstr "" +msgstr "Neue Restream Konfiguration erstellen" #: restream/templates/restream/restreamconfig_form.html:14 #: restream/templates/restream/restreamconfig_update_form.html:14 @@ -98,7 +107,7 @@ msgstr "" #: templates/registration/password_change_form.html:13 #: templates/registration/password_reset_form.html:13 msgid "submit" -msgstr "" +msgstr "Abschicken" #: restream/templates/restream/restreamconfig_form.html:21 msgid "create_new_restreamconfig_configuration_text_html" @@ -106,30 +115,30 @@ msgstr "" #: restream/templates/restream/restreamconfig_list.html:8 msgid "restreamconfig_configuration_header" -msgstr "" +msgstr "Restream Konfiguration" #: restream/templates/restream/restreamconfig_list.html:12 #: rtmp/templates/rtmp/stream_list.html:12 msgid "create" -msgstr "" +msgstr "Erstellen" #: restream/templates/restream/restreamconfig_list.html:19 msgid "active" -msgstr "" +msgstr "Aktiv" #: restream/templates/restream/restreamconfig_list.html:20 #: rtmp/templates/rtmp/stream_list.html:20 msgid "actions" -msgstr "" +msgstr "Aktionen" #: restream/templates/restream/restreamconfig_list.html:38 #: rtmp/templates/rtmp/stream_list.html:38 msgid "details" -msgstr "" +msgstr "Details" #: restream/templates/restream/restreamconfig_update_form.html:5 msgid "update_restreamconfig_configuration_header" -msgstr "" +msgstr "Restream Konfiguration anpassen" #: restream/templates/restream/restreamconfig_update_form.html:21 msgid "update_restreamconfig_configuration_text_html" @@ -137,80 +146,82 @@ msgstr "" #: rtmp/models.py:13 msgid "rtmp_application_name" -msgstr "" +msgstr "RTMP Application Name" #: rtmp/models.py:16 msgid "application_verbose_name" -msgstr "" +msgstr "Application" #: rtmp/models.py:17 msgid "application_verbose_name_plural" -msgstr "" +msgstr "Applications" #: rtmp/models.py:20 msgid "aplication_class_name" -msgstr "" +msgstr "Application" #: rtmp/models.py:27 msgid "stream_application_help" -msgstr "" +msgstr "Unter welcher RTMP Application gilt diese Stream ID" #: rtmp/models.py:28 msgid "stream_stream_help" -msgstr "" +msgstr "RTMP Stream ID" #: rtmp/models.py:29 msgid "stream_name_help" -msgstr "" +msgstr "Name für diesen Stream" #: rtmp/models.py:68 msgid "stream_class_name" -msgstr "" +msgstr "Stream" #: rtmp/templates/rtmp/stream_confirm_delete.html:13 msgid "deleting_stream_configuration_will_also_delete_all_depending_confgurations_warning" msgstr "" +"Achtung! Beim Löschen dieser Stream Konfiguration werden auch alle " +"abhängigen Konfigurationen gelöscht." #: rtmp/templates/rtmp/stream_confirm_delete.html:15 #, python-format msgid "are_you_sure_you_want_to_delete_\"%(stream_config_name)s\"?" -msgstr "" +msgstr "Willst du wirklich \"%(stream_config_name)s\" löschen?" #: rtmp/templates/rtmp/stream_confirm_delete.html:25 msgid "deleting_configurations_list_header" -msgstr "" +msgstr "Diese Konfigurationen werden gelöscht" #: rtmp/templates/rtmp/stream_detail.html:12 msgid "stream_configuration_details_header" -msgstr "" +msgstr "Stream Konfiguration Details" #: rtmp/templates/rtmp/stream_detail.html:30 msgid "application" -msgstr "" +msgstr "Application" #: rtmp/templates/rtmp/stream_detail.html:33 msgid "stream_configuration_do_not_share_warning" -msgstr "" +msgstr "Achtung! Gebe diese Stream ID niemals weiter." #: rtmp/templates/rtmp/stream_detail.html:36 msgid "how_to_configure_your_encoder_header" -msgstr "" +msgstr "Wie du deinen Encoder konfigurierst" #: rtmp/templates/rtmp/stream_detail.html:38 msgid "set_this_stream_server_in_encoder" -msgstr "" +msgstr "Stelle diesen Stream Server in deinem Encoder ein" #: rtmp/templates/rtmp/stream_detail.html:40 msgid "set_this_stream_id_in_encoder" -msgstr "" +msgstr "Stelle diese Stream ID in deinem Encoder ein" #: rtmp/templates/rtmp/stream_detail.html:48 msgid "you_may_need_to_use_this_full_url_instead" -msgstr "" +msgstr "Vielleicht musst du diese volle URL verwenden" #: rtmp/templates/rtmp/stream_form.html:5 msgid "create_new_stream_configuration_header" -msgstr "" +msgstr "Neue Stream Konfiguration erstellen" #: rtmp/templates/rtmp/stream_form.html:21 msgid "create_new_stream_configuration_text_html" @@ -218,63 +229,60 @@ msgstr "" #: rtmp/templates/rtmp/stream_list.html:8 msgid "stream_configuration_header" -msgstr "" +msgstr "Stream Konfiguration" #: rtmp/templates/rtmp/stream_list.html:19 -msgid "publishing" -msgstr "" +msgid "receiving" +msgstr "Empfängt" #: rtmp/templates/rtmp/stream_update_form.html:5 msgid "update_stream_configuration_header" -msgstr "" +msgstr "Stream Konfiguration anpassen" #: rtmp/templates/rtmp/stream_update_form.html:21 msgid "update_stream_configuration_text_html" msgstr "" #: templates/base.html:36 -msgid "navbar_configuration" -msgstr "" +msgid "navbar_streaming" +msgstr "Streaming" #: templates/base.html:39 -msgid "navbar_configuration_streaming_header" -msgstr "" +msgid "navbar_configuration_streams" +msgstr "Streams" #: templates/base.html:40 -msgid "navbar_configuration_streams" -msgstr "" - -#: templates/base.html:41 msgid "navbar_configuration_restreams" -msgstr "" +msgstr "Restreams" -#: templates/base.html:43 -msgid "navbar_configuration_account_header" -msgstr "" - -#: templates/base.html:44 -msgid "navbar_configuration_password_change" -msgstr "" +#: templates/base.html:47 +#, python-format +msgid "hello_%(username)s" +msgstr "Hallo, %(username)s!" #: templates/base.html:50 -msgid "navbar_logout" -msgstr "" +msgid "navbar_account_password_change" +msgstr "Passwort ändern" -#: templates/base.html:52 +#: templates/base.html:51 +msgid "navbar_account_logout" +msgstr "Abmelden" + +#: templates/base.html:55 msgid "navbar_login" -msgstr "" +msgstr "Anmelden" #: templates/registration/login.html:5 templates/registration/login.html:13 msgid "login" -msgstr "" +msgstr "Anmelden" #: templates/registration/login.html:18 msgid "forgot_password_q" -msgstr "" +msgstr "Passwort vergessen?" #: templates/registration/password_change_done.html:5 msgid "password_change_successful" -msgstr "" +msgstr "Passwort erfolgreich geändert" #: templates/registration/password_change_done.html:6 msgid "password_change_successful_text" @@ -282,11 +290,11 @@ msgstr "" #: templates/registration/password_change_done.html:7 msgid "take_me_to_safety" -msgstr "" +msgstr "Bring mich in Sicherheit!" #: templates/registration/password_change_form.html:5 msgid "change_password" -msgstr "" +msgstr "Passwort ändern" #: templates/registration/password_change_form.html:20 msgid "change_password_text_html" diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index cf015c4..b87b3c0 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-05-01 12:17+0000\n" +"POT-Creation-Date: 2020-05-01 17:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,6 +18,14 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: portier/settings.py:139 +msgid "German" +msgstr "German" + +#: portier/settings.py:140 +msgid "English" +msgstr "English" + #: restream/models.py:11 msgid "restreamconfig_stream_help" msgstr "" @@ -36,60 +44,60 @@ msgstr "" #: restream/models.py:17 msgid "restreamconfig_verbose_name" -msgstr "" +msgstr "Restream configuration" #: restream/models.py:18 msgid "restreamconfig_verbose_name_plural" -msgstr "" +msgstr "Restream configurations" #: restream/models.py:21 msgid "restreamconfig_class_name" -msgstr "" +msgstr "Restream configuration" #: restream/templates/restream/restreamconfig_confirm_delete.html:6 #: rtmp/templates/rtmp/stream_confirm_delete.html:6 msgid "confirm_delete_header" -msgstr "" +msgstr "Confirm deletion" #: restream/templates/restream/restreamconfig_confirm_delete.html:12 #, python-format msgid "are_you_sure_you_want_to_delete_\"%(restreamconfig_config_name)s\"?" -msgstr "" +msgstr "Are you sure you want to delete \"%(restreamconfig_config_name)s\"?" #: restream/templates/restream/restreamconfig_confirm_delete.html:15 #: restream/templates/restream/restreamconfig_detail.html:20 #: rtmp/templates/rtmp/stream_confirm_delete.html:18 #: rtmp/templates/rtmp/stream_detail.html:20 msgid "delete" -msgstr "" +msgstr "Delete" #: restream/templates/restream/restreamconfig_detail.html:12 msgid "restreamconfig_configuration_details_header" -msgstr "" +msgstr "Restream configuration details" #: restream/templates/restream/restreamconfig_detail.html:17 #: rtmp/templates/rtmp/stream_detail.html:17 msgid "change" -msgstr "" +msgstr "Change" #: restream/templates/restream/restreamconfig_detail.html:28 #: restream/templates/restream/restreamconfig_list.html:18 #: rtmp/templates/rtmp/stream_detail.html:28 #: rtmp/templates/rtmp/stream_list.html:18 msgid "name" -msgstr "" +msgstr "Name" #: restream/templates/restream/restreamconfig_detail.html:30 msgid "stream" -msgstr "" +msgstr "Stream" #: restream/templates/restream/restreamconfig_detail.html:35 msgid "configured_target_url" -msgstr "" +msgstr "Configured target URL" #: restream/templates/restream/restreamconfig_form.html:5 msgid "create_new_restreamconfig_configuration_header" -msgstr "" +msgstr "Create new restream configuration" #: restream/templates/restream/restreamconfig_form.html:14 #: restream/templates/restream/restreamconfig_update_form.html:14 @@ -98,7 +106,7 @@ msgstr "" #: templates/registration/password_change_form.html:13 #: templates/registration/password_reset_form.html:13 msgid "submit" -msgstr "" +msgstr "Submit" #: restream/templates/restream/restreamconfig_form.html:21 msgid "create_new_restreamconfig_configuration_text_html" @@ -106,30 +114,30 @@ msgstr "" #: restream/templates/restream/restreamconfig_list.html:8 msgid "restreamconfig_configuration_header" -msgstr "" +msgstr "Restream configuration" #: restream/templates/restream/restreamconfig_list.html:12 #: rtmp/templates/rtmp/stream_list.html:12 msgid "create" -msgstr "" +msgstr "Create" #: restream/templates/restream/restreamconfig_list.html:19 msgid "active" -msgstr "" +msgstr "Active" #: restream/templates/restream/restreamconfig_list.html:20 #: rtmp/templates/rtmp/stream_list.html:20 msgid "actions" -msgstr "" +msgstr "Actions" #: restream/templates/restream/restreamconfig_list.html:38 #: rtmp/templates/rtmp/stream_list.html:38 msgid "details" -msgstr "" +msgstr "Details" #: restream/templates/restream/restreamconfig_update_form.html:5 msgid "update_restreamconfig_configuration_header" -msgstr "" +msgstr "Update restream configuration" #: restream/templates/restream/restreamconfig_update_form.html:21 msgid "update_restreamconfig_configuration_text_html" @@ -137,80 +145,82 @@ msgstr "" #: rtmp/models.py:13 msgid "rtmp_application_name" -msgstr "" +msgstr "RTMP application name" #: rtmp/models.py:16 msgid "application_verbose_name" -msgstr "" +msgstr "RTMP application" #: rtmp/models.py:17 msgid "application_verbose_name_plural" -msgstr "" +msgstr "RTMP applications" #: rtmp/models.py:20 msgid "aplication_class_name" -msgstr "" +msgstr "Application" #: rtmp/models.py:27 msgid "stream_application_help" -msgstr "" +msgstr "Application which the stream is assigned to" #: rtmp/models.py:28 msgid "stream_stream_help" -msgstr "" +msgstr "Stream ID for this stream" #: rtmp/models.py:29 msgid "stream_name_help" -msgstr "" +msgstr "Name for this stream" #: rtmp/models.py:68 msgid "stream_class_name" -msgstr "" +msgstr "Stream" #: rtmp/templates/rtmp/stream_confirm_delete.html:13 msgid "deleting_stream_configuration_will_also_delete_all_depending_confgurations_warning" msgstr "" +"Attention! Deleting this stream configuration will also delete all depending " +"configurations." #: rtmp/templates/rtmp/stream_confirm_delete.html:15 #, python-format msgid "are_you_sure_you_want_to_delete_\"%(stream_config_name)s\"?" -msgstr "" +msgstr "Are you sure you want to delete \"%(stream_config_name)s\"?" #: rtmp/templates/rtmp/stream_confirm_delete.html:25 msgid "deleting_configurations_list_header" -msgstr "" +msgstr "List of deleted configurations" #: rtmp/templates/rtmp/stream_detail.html:12 msgid "stream_configuration_details_header" -msgstr "" +msgstr "Stream configuration details" #: rtmp/templates/rtmp/stream_detail.html:30 msgid "application" -msgstr "" +msgstr "Application" #: rtmp/templates/rtmp/stream_detail.html:33 msgid "stream_configuration_do_not_share_warning" -msgstr "" +msgstr "Attention! Do not share this stream ID with anyone." #: rtmp/templates/rtmp/stream_detail.html:36 msgid "how_to_configure_your_encoder_header" -msgstr "" +msgstr "How to configure your encoder" #: rtmp/templates/rtmp/stream_detail.html:38 msgid "set_this_stream_server_in_encoder" -msgstr "" +msgstr "Set this stream server in your encoder" #: rtmp/templates/rtmp/stream_detail.html:40 msgid "set_this_stream_id_in_encoder" -msgstr "" +msgstr "Set this stream ID in your encoder" #: rtmp/templates/rtmp/stream_detail.html:48 msgid "you_may_need_to_use_this_full_url_instead" -msgstr "" +msgstr "You may need to use this full URL instead" #: rtmp/templates/rtmp/stream_form.html:5 msgid "create_new_stream_configuration_header" -msgstr "" +msgstr "Create new stream configuration" #: rtmp/templates/rtmp/stream_form.html:21 msgid "create_new_stream_configuration_text_html" @@ -218,63 +228,60 @@ msgstr "" #: rtmp/templates/rtmp/stream_list.html:8 msgid "stream_configuration_header" -msgstr "" +msgstr "Stream configuration" #: rtmp/templates/rtmp/stream_list.html:19 -msgid "publishing" -msgstr "" +msgid "receiving" +msgstr "Receiving" #: rtmp/templates/rtmp/stream_update_form.html:5 msgid "update_stream_configuration_header" -msgstr "" +msgstr "Change stream configuration" #: rtmp/templates/rtmp/stream_update_form.html:21 msgid "update_stream_configuration_text_html" msgstr "" #: templates/base.html:36 -msgid "navbar_configuration" -msgstr "" +msgid "navbar_streaming" +msgstr "Streaming" #: templates/base.html:39 -msgid "navbar_configuration_streaming_header" -msgstr "" +msgid "navbar_configuration_streams" +msgstr "Streams" #: templates/base.html:40 -msgid "navbar_configuration_streams" -msgstr "" - -#: templates/base.html:41 msgid "navbar_configuration_restreams" -msgstr "" +msgstr "Restreams" -#: templates/base.html:43 -msgid "navbar_configuration_account_header" -msgstr "" - -#: templates/base.html:44 -msgid "navbar_configuration_password_change" -msgstr "" +#: templates/base.html:47 +#, python-format +msgid "hello_%(username)s" +msgstr "Hello, %(username)s!" #: templates/base.html:50 -msgid "navbar_logout" -msgstr "" +msgid "navbar_account_password_change" +msgstr "Change password" -#: templates/base.html:52 +#: templates/base.html:51 +msgid "navbar_account_logout" +msgstr "Logout" + +#: templates/base.html:55 msgid "navbar_login" -msgstr "" +msgstr "Login" #: templates/registration/login.html:5 templates/registration/login.html:13 msgid "login" -msgstr "" +msgstr "Login" #: templates/registration/login.html:18 msgid "forgot_password_q" -msgstr "" +msgstr "Did you forget your password?" #: templates/registration/password_change_done.html:5 msgid "password_change_successful" -msgstr "" +msgstr "Password change was successful" #: templates/registration/password_change_done.html:6 msgid "password_change_successful_text" @@ -282,11 +289,11 @@ msgstr "" #: templates/registration/password_change_done.html:7 msgid "take_me_to_safety" -msgstr "" +msgstr "Help! Take me back to safety!" #: templates/registration/password_change_form.html:5 msgid "change_password" -msgstr "" +msgstr "Change password" #: templates/registration/password_change_form.html:20 msgid "change_password_text_html" diff --git a/portier/settings.py b/portier/settings.py index c2aa042..3d304b4 100644 --- a/portier/settings.py +++ b/portier/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ """ import os +from django.utils.translation import gettext_lazy as _ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -42,7 +43,7 @@ INSTALLED_APPS = [ 'guardian', 'django_registration', 'bootstrap4', - 'fa', + 'fontawesome_5', 'core.apps.CoreConfig', 'portal.apps.PortalConfig', 'rtmp.apps.RtmpConfig', @@ -53,6 +54,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -133,6 +135,16 @@ USE_I18N = True USE_L10N = True USE_TZ = True +LANGUAGES = [ + ('de', _('German')), + ('en', _('English')), +] + +LOCALE_PATHS = ( + os.path.join(BASE_DIR, 'locale'), +) + + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/3.0/howto/static-files/ diff --git a/portier/urls.py b/portier/urls.py index 69b3861..98d03f3 100644 --- a/portier/urls.py +++ b/portier/urls.py @@ -19,6 +19,7 @@ from django.urls import include, path urlpatterns = [ path('accounts/', include('django_registration.backends.activation.urls')), path('accounts/', include('django.contrib.auth.urls')), + path('i18n/', include('django.conf.urls.i18n')), path('admin/', admin.site.urls), path('rtmp/', include('rtmp.urls')), path('restream/', include('restream.urls')), diff --git a/requirements.txt b/requirements.txt index 5960f3e..7b5836e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ django>=3.0 django-registration>=3.1 django-bootstrap4 django-guardian -django-fa +django-fontawesome-5 celery>=4.4 gunicorn>=20 psycopg2-binary diff --git a/restream/templates/restream/restreamconfig_confirm_delete.html b/restream/templates/restream/restreamconfig_confirm_delete.html index 71134d6..9678bb3 100644 --- a/restream/templates/restream/restreamconfig_confirm_delete.html +++ b/restream/templates/restream/restreamconfig_confirm_delete.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load i18n %} {% load bootstrap4 %} -{% load font_awesome %} +{% load fontawesome_5 %} {% block 'content' %}
{% trans "confirm_delete_header" %}

@@ -12,7 +12,7 @@

{% blocktrans with restreamconfig_config_name=object.name %}are_you_sure_you_want_to_delete_"{{ restreamconfig_config_name }}"?{% endblocktrans %}

{% buttons %} {% endbuttons %} diff --git a/restream/templates/restream/restreamconfig_detail.html b/restream/templates/restream/restreamconfig_detail.html index 12d8815..d61805a 100644 --- a/restream/templates/restream/restreamconfig_detail.html +++ b/restream/templates/restream/restreamconfig_detail.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load i18n %} {% load bootstrap4 %} -{% load font_awesome %} +{% load fontawesome_5 %} {% load guardian_tags %} {% get_obj_perms user for object as "obj_perms" %} @@ -14,10 +14,10 @@ {% get_obj_perms user for object as "obj_perms" %}
{% if "change_restreamconfig" in obj_perms %} - {% fa 'pencil' %} {% trans 'change' %} + {% fa5_icon 'edit' %} {% trans 'change' %} {% endif %} {% if "delete_restreamconfig" in obj_perms %} - {% fa 'trash' %} {% trans 'delete' %} + {% fa5_icon 'trash' %} {% trans 'delete' %} {% endif %}
diff --git a/restream/templates/restream/restreamconfig_list.html b/restream/templates/restream/restreamconfig_list.html index 40c61fc..9fd27ae 100644 --- a/restream/templates/restream/restreamconfig_list.html +++ b/restream/templates/restream/restreamconfig_list.html @@ -1,19 +1,26 @@ {% extends 'base.html' %} {% load i18n %} {% load bootstrap4 %} -{% load font_awesome %} +{% load fontawesome_5 %} {% load guardian_tags %} {% block 'content' %} -
{% trans "restreamconfig_configuration_header" %}
-
-