From 5e2a58c76433847ab9cb34881e761224dec51973 Mon Sep 17 00:00:00 2001 From: Mojib Wali <44528277+mb-wali@users.noreply.github.com> Date: Thu, 22 Apr 2021 09:45:42 +0200 Subject: [PATCH] i18n: adds translation * babel: adds a wildcard to extract txt files. * refactor txt file --- babel.ini | 2 +- .../templates/security/email/welcome.html | 18 +++---- .../templates/security/email/welcome.txt | 13 +++-- .../translations/de/LC_MESSAGES/messages.po | 49 ++++++++++++++++--- .../translations/messages.pot | 47 +++++++++++++++--- 5 files changed, 98 insertions(+), 31 deletions(-) diff --git a/babel.ini b/babel.ini index 6e7e00d..3320fd8 100644 --- a/babel.ini +++ b/babel.ini @@ -13,7 +13,7 @@ encoding = utf-8 # Extraction from Jinja2 templates -[jinja2: **/templates/**.html] +[jinja2: **/templates/**.*] encoding = utf-8 extensions = jinja2.ext.autoescape, jinja2.ext.with_ diff --git a/invenio_config_tugraz/templates/security/email/welcome.html b/invenio_config_tugraz/templates/security/email/welcome.html index 5c7eb5d..4323c45 100644 --- a/invenio_config_tugraz/templates/security/email/welcome.html +++ b/invenio_config_tugraz/templates/security/email/welcome.html @@ -1,17 +1,11 @@ -

- {% trans salut=current_userprofile.full_name or user.email %} - Dear {{ salut }}! - {% endtrans %} -

+

{{ _('Dear %(email)s!', email=user.email) }}

+ +

{{ _('To help you get started, here are some useful links:') }}

- {{ _('To help you get started, here are some useful links:') }} -

- -

- {{ _('TU Graz Repository') }}
- {{ _('Reference Guide') }}
- {{ _('Terms and Conditions') }}
+ {{ _('TU Graz Repository') }}
+ {{ _('Reference Guide') }}
+ {{ _('Terms and Conditions') }}

{% if security.confirmable %} diff --git a/invenio_config_tugraz/templates/security/email/welcome.txt b/invenio_config_tugraz/templates/security/email/welcome.txt index 0a02f92..69f5906 100644 --- a/invenio_config_tugraz/templates/security/email/welcome.txt +++ b/invenio_config_tugraz/templates/security/email/welcome.txt @@ -1,9 +1,16 @@ {{ _('Dear %(email)s!', email=user.email) }} + {{ _('To help you get started, here are some useful links:') }} - {{ _('Repository')}}: https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.index') }} - {{ _('Repository Guide')}}: https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.guide') }} - {{ _('Terms And Conditions')}}: https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.terms') }} +{{ _('Repository')}} +https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.index') }} + +{{ _('Repository Guide')}} +https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.guide') }} + +{{ _('Terms And Conditions') }} +https://{{ config.SITE_HOSTNAME }}{{ url_for('invenio_theme_tugraz.terms') }} + {% if security.confirmable %} {{ _('You can confirm your email through the link below:') }} diff --git a/invenio_config_tugraz/translations/de/LC_MESSAGES/messages.po b/invenio_config_tugraz/translations/de/LC_MESSAGES/messages.po index 118c3f9..24cda1c 100644 --- a/invenio_config_tugraz/translations/de/LC_MESSAGES/messages.po +++ b/invenio_config_tugraz/translations/de/LC_MESSAGES/messages.po @@ -1,15 +1,15 @@ # German translations for invenio-config-tugraz. -# Copyright (C) 2020 Mojib Wali +# Copyright (C) 2021 Mojib Wali # This file is distributed under the same license as the # invenio-config-tugraz project. -# FIRST AUTHOR , 2020. +# FIRST AUTHOR , 2021. # msgid "" msgstr "" -"Project-Id-Version: invenio-config-tugraz 0.1.5\n" +"Project-Id-Version: invenio-config-tugraz 0.5.4\n" "Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n" -"POT-Creation-Date: 2020-10-06 09:28+0200\n" -"PO-Revision-Date: 2020-10-06 09:28+0200\n" +"POT-Creation-Date: 2021-04-22 09:24+0200\n" +"PO-Revision-Date: 2021-04-22 09:12+0200\n" "Last-Translator: FULL NAME \n" "Language: de\n" "Language-Team: de \n" @@ -17,9 +17,42 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.8.0\n" +"Generated-By: Babel 2.9.0\n" -#: invenio_config_tugraz/config.py:80 -msgid "Welcome to RDM!" +#: invenio_config_tugraz/config.py:87 +msgid "Welcome to TU Graz Repository!" +msgstr "Willkommen im TU Graz Repository!" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:1 +#, python-format +msgid "Dear %(email)s!" +msgstr "Lieber %(email)s!" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:3 +msgid "To help you get started, here are some useful links:" +msgstr "Um Ihnen den Einstieg zu erleichtern, finden Sie hier einige nützliche Links:" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:5 +msgid "Repository" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:8 +msgid "Repository Guide" +msgstr "Handbuch" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:11 +msgid "Terms And Conditions" +msgstr "Nutzungsbedingungen" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:16 +msgid "You can confirm your email through the link below:" +msgstr "Sie können Ihre E-Mail über den folgenden Link bestätigen:" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:20 +msgid "Best regards" +msgstr "Liebe grüße" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:21 +msgid "TU Graz Repository Team" msgstr "" diff --git a/invenio_config_tugraz/translations/messages.pot b/invenio_config_tugraz/translations/messages.pot index a9d587f..9aacf5a 100644 --- a/invenio_config_tugraz/translations/messages.pot +++ b/invenio_config_tugraz/translations/messages.pot @@ -1,24 +1,57 @@ # Translations template for invenio-config-tugraz. -# Copyright (C) 2020 Mojib Wali +# Copyright (C) 2021 Mojib Wali # This file is distributed under the same license as the # invenio-config-tugraz project. -# FIRST AUTHOR , 2020. +# FIRST AUTHOR , 2021. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: invenio-config-tugraz 0.1.5\n" +"Project-Id-Version: invenio-config-tugraz 0.5.4\n" "Report-Msgid-Bugs-To: mojib.wali@tugraz.at\n" -"POT-Creation-Date: 2020-10-06 09:28+0200\n" +"POT-Creation-Date: 2021-04-22 09:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.8.0\n" +"Generated-By: Babel 2.9.0\n" -#: invenio_config_tugraz/config.py:80 -msgid "Welcome to RDM!" +#: invenio_config_tugraz/config.py:87 +msgid "Welcome to TU Graz Repository!" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:1 +#, python-format +msgid "Dear %(email)s!" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:3 +msgid "To help you get started, here are some useful links:" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:5 +msgid "Repository" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:8 +msgid "Repository Guide" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:11 +msgid "Terms And Conditions" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:16 +msgid "You can confirm your email through the link below:" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:20 +msgid "Best regards" +msgstr "" + +#: invenio_config_tugraz/templates/security/email/welcome.txt:21 +msgid "TU Graz Repository Team" msgstr ""