From 9cdf31492a998338fec5f23f1718b56ff2310f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 1 Dec 2019 13:50:43 +0100 Subject: [PATCH] Added german translations for password reset dialogs and email --- composer.json | 1 + composer.lock | 59 ++++++++++++++- src/Controller/SecurityController.php | 2 +- symfony.lock | 3 + templates/mail/base.html.twig | 2 +- templates/mail/pw_reset.html.twig | 16 ++--- translations/messages.de.xlf | 100 ++++++++++++++++++++++++-- translations/messages.en.xlf | 100 ++++++++++++++++++++++++-- 8 files changed, 259 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index 9b25077f..65bb24c0 100644 --- a/composer.json +++ b/composer.json @@ -53,6 +53,7 @@ "twig/extra-bundle": "^3.0", "twig/inky-extra": "^3.0", "twig/intl-extra": "^3.0", + "twig/markdown-extra": "^3.0", "webmozart/assert": "^1.4" }, "require-dev": { diff --git a/composer.lock b/composer.lock index c3d7ebc9..add3ec58 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "733245d6c57c1dc9a4ebe51098d64efe", + "content-hash": "1cbea7e2967b60791fefef2c4642b9bd", "packages": [ { "name": "clue/stream-filter", @@ -8029,6 +8029,63 @@ ], "time": "2019-11-15T20:33:33+00:00" }, + { + "name": "twig/markdown-extra", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/markdown-extra.git", + "reference": "609989e5bdc8cdb282e37fdc54e3591c244b5501" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/markdown-extra/zipball/609989e5bdc8cdb282e37fdc54e3591c244b5501", + "reference": "609989e5bdc8cdb282e37fdc54e3591c244b5501", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "twig/twig": "^2.4|^3.0" + }, + "require-dev": { + "erusev/parsedown": "^1.7", + "league/commonmark": "^1.0", + "league/html-to-markdown": "^4.8", + "michelf/php-markdown": "^1.8", + "symfony/phpunit-bridge": "^4.4@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Twig\\Extra\\Markdown\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + } + ], + "description": "A Twig extension for Markdown", + "homepage": "https://twig.symfony.com", + "keywords": [ + "html", + "markdown", + "twig" + ], + "time": "2019-10-17T07:30:08+00:00" + }, { "name": "twig/twig", "version": "v2.12.2", diff --git a/src/Controller/SecurityController.php b/src/Controller/SecurityController.php index 0a712d68..16b0e8b8 100644 --- a/src/Controller/SecurityController.php +++ b/src/Controller/SecurityController.php @@ -82,7 +82,7 @@ class SecurityController extends AbstractController $builder = $this->createFormBuilder(); $builder->add('user', TextType::class, [ - 'label' => $this->translator->trans('pw_reset.user_or_password'), + 'label' => $this->translator->trans('pw_reset.user_or_email'), 'constraints' => [new NotBlank()] ]); $builder->add('captcha', CaptchaType::class, [ diff --git a/symfony.lock b/symfony.lock index a7a116bf..f4990713 100644 --- a/symfony.lock +++ b/symfony.lock @@ -730,6 +730,9 @@ "twig/intl-extra": { "version": "3.x-dev" }, + "twig/markdown-extra": { + "version": "v3.0.0" + }, "twig/twig": { "version": "v2.6.2" }, diff --git a/templates/mail/base.html.twig b/templates/mail/base.html.twig index 666a03f7..ee466b79 100644 --- a/templates/mail/base.html.twig +++ b/templates/mail/base.html.twig @@ -21,7 +21,7 @@ -

This email was send automatically by Part-DB. Dont answer to this email.

+

{% trans %}mail.footer.email_sent_by{% endtrans %} Part-DB. {% trans %}mail.footer.dont_reply{% endtrans %}

diff --git a/templates/mail/pw_reset.html.twig b/templates/mail/pw_reset.html.twig index b6ddecf9..4a2794da 100644 --- a/templates/mail/pw_reset.html.twig +++ b/templates/mail/pw_reset.html.twig @@ -3,27 +3,25 @@ {% block content %} -

Hi {{ user.fullName }},

- somebody (hopefully you) requested an reset of your password. - If this request was not made by you, ignore this email. +

{% trans with {'%name%': user.fullName} %}email.hi %name%{% endtrans %},

+ {% trans %}email.pw_reset.message{% endtrans %}
- +
- If this dont work for you. Go to {{ url('pw_reset_new_pw') }} - and enter the following info: + {% trans with {'%url%': url('pw_reset_new_pw') } %}email.pw_reset.fallback{% endtrans %}:

- Username: {{ user.name }} + {% trans %}email.pw_reset.username{% endtrans %}: {{ user.name }}

- Token: {{ token }} + {% trans %}email.pw_reset.token{% endtrans %}: {{ token }}

- The reset token will be valid until {{ expiration_date|format_datetime }}. + {% trans with {'%date%' : expiration_date|format_datetime} %}email.pw_reset.valid_unit %date%{% endtrans %}
diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf index ad378a0f..01250cd3 100644 --- a/translations/messages.de.xlf +++ b/translations/messages.de.xlf @@ -808,37 +808,37 @@ Subelemente werden beim Löschen nach oben verschoben. Success Flash Message! - + src\Controller\DebugController.php:45 new Error Flash Message! - + src\Controller\DebugController.php:46 new Warning Flash Message! - + src\Controller\DebugController.php:47 new Notice Flash Message! - + src\Controller\DebugController.php:48 new Info Flash Message! <b>Test</b> - + src\Controller\DebugController.php:49 new Blabla. This message type should be not know to template! - + src\Controller\DebugController.php:51 new @@ -2450,6 +2450,94 @@ Element 3 part.table.attachments Dateianhänge + + pw_reset.user_or_email + Benutzername / Email + + + pw_reset.request.success + Passwort Anfrage erfolgreich! Überprüfen Sie Ihre Emails für weitere Informationen. + + + pw_reset.username + Benutzername + + + pw_reset.token + Token + + + pw_reset.new_pw.error + Benutzername oder Token ungültig! Überprüfen Sie ihre Eingaben. + + + pw_reset.new_pw.success + Passwort wurde erfolgreich zurückgesetzt. Sie können sich nun mit dem neuen Passwort einloggen. + + + attachment.table.type + Anhangstyp + + + pw_reset.email.subject + Passwort Reset für Ihren Part-DB Account + + + mail.footer.email_sent_by + Diese Email wurde automatisch erstellt von + + + mail.footer.dont_reply + Antworten Sie nicht auf diese Email. + + + email.hi %name% + Hallo %name% + + + email.pw_reset.message + jemand (hoffentlich Sie) hat ein Reset ihres Passwortes angefordert. Wenn diese Anfrage nicht von Ihnen stammt, ignorieren sie diese Email. + + + email.pw_reset.button + Passwort zurücksetzen + + + email.pw_reset.fallback + %url% auf und geben Sie die folgenden Daten ein]]> + + + email.pw_reset.username + Benutzername + + + email.pw_reset.token + Token + + + email.pw_reset.valid_unit %date% + %date%]]> + + + pw_reset.password_forget + Nutzername/Passwort vergessen? + + + pw_reset.new_pw.header.title + Neues Passwort setzen + + + pw_reset.request.header.title + Neues Passwort anfordern + + + ui.toggle_darkmode + Darkmode + + + pw_reset.submit + Passwort zurücksetzen + diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index 99abf932..3bf91d0a 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -777,32 +777,32 @@ Subelements will be moved upwards.]]> Success Flash Message! - + src\Controller\DebugController.php:45 Error Flash Message! - + src\Controller\DebugController.php:46 Warning Flash Message! - + src\Controller\DebugController.php:47 Notice Flash Message! - + src\Controller\DebugController.php:48 Info Flash Message! <b>Test</b> - + src\Controller\DebugController.php:49 Blabla. This message type should be not know to template! - + src\Controller\DebugController.php:51 @@ -2421,6 +2421,94 @@ Element 3 part.table.attachments Attachments + + pw_reset.user_or_email + Username / Email + + + pw_reset.request.success + Reset request was successful! Please check your emails for further instructions. + + + pw_reset.username + Username + + + pw_reset.token + Token + + + pw_reset.new_pw.error + Username or Token invalid! Please check your input. + + + pw_reset.new_pw.success + Password was reset successfully. You can now login with your new password. + + + attachment.table.type + Attachment type + + + pw_reset.email.subject + Password reset for your Part-DB account + + + mail.footer.email_sent_by + This email was sent automatically by + + + mail.footer.dont_reply + Do not answer to this email. + + + email.hi %name% + Hi %name% + + + email.pw_reset.message + somebody (hopefully you) requested a reset of your password. If this request was not made by you, ignore this mail. + + + email.pw_reset.button + Click here to reset password + + + email.pw_reset.fallback + %url% and enter the following info]]> + + + email.pw_reset.username + Username + + + email.pw_reset.token + Token + + + email.pw_reset.valid_unit %date% + %date%.]]> + + + pw_reset.password_forget + Forgot username/password? + + + pw_reset.new_pw.header.title + Set new password + + + pw_reset.request.header.title + Request a new password + + + ui.toggle_darkmode + Darkmode + + + pw_reset.submit + Reset password +