From dbbf1bb54bbaecce76ee1c4b73beca0298d724f0 Mon Sep 17 00:00:00 2001
From: Camille Simiand <camille.simiand@tetras-libre.fr>
Date: Wed, 12 Jan 2022 15:28:58 +0100
Subject: [PATCH] Add missing french and english translations

---
 .../registration/confirmation_email.html.twig    | 16 +++++++++++-----
 templates/registration/register.html.twig        |  5 ++++-
 .../registration/register_mail_sent.html.twig    |  8 ++++++--
 templates/reset_password/email.html.twig         |  4 ++--
 tests/functional/RegistrationControllerTest.php  |  2 +-
 translations/messages.en.yaml                    | 14 +++++++++++---
 translations/messages.fr.yaml                    | 15 +++++++++++----
 7 files changed, 46 insertions(+), 18 deletions(-)

diff --git a/templates/registration/confirmation_email.html.twig b/templates/registration/confirmation_email.html.twig
index bc307f2..3d9a474 100644
--- a/templates/registration/confirmation_email.html.twig
+++ b/templates/registration/confirmation_email.html.twig
@@ -1,11 +1,17 @@
-<h1>Hi! Please confirm your email!</h1>
+<h1>
+    {{ 'registration.email.title'|trans }}
+</h1>
 
 <p>
-    Please confirm your email address by clicking the following link: <br><br>
-    <a href="{{ signedUrl }}">Confirm my Email</a>.
-    This link will expire in {{ expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle') }}.
+    {{ 'registration.email.text'|trans }}:
+    <br><br>
+    <a href="{{ signedUrl }}">
+        {{ 'registration.email.confirm_email'|trans }}
+    </a>
+    {{ 'general.link_expire'|trans({'%expirationDuration%':
+        expiresAtMessageKey|trans(expiresAtMessageData, 'VerifyEmailBundle')}) }}
 </p>
 
 <p>
-    Cheers!
+    {{ 'general.greeting'|trans }}
 </p>
diff --git a/templates/registration/register.html.twig b/templates/registration/register.html.twig
index 7333e24..45e7b0f 100644
--- a/templates/registration/register.html.twig
+++ b/templates/registration/register.html.twig
@@ -1,6 +1,9 @@
 {% extends 'connexion.html.twig' %}
 
-{% block title %}Register{% endblock %}
+{% block title %}
+    {{ 'registration.register'|trans }}
+{% endblock %}
+
 {% block body %}
   <div class="mt-4">
     {% for flashError in app.flashes('verify_email_error') %}
diff --git a/templates/registration/register_mail_sent.html.twig b/templates/registration/register_mail_sent.html.twig
index fb44dc6..108891b 100644
--- a/templates/registration/register_mail_sent.html.twig
+++ b/templates/registration/register_mail_sent.html.twig
@@ -1,10 +1,14 @@
 {% extends 'layout.html.twig' %}
-{% block title %}Mail registration sent{% endblock %}
+{% block title %}
+  {{ 'registration.email_sent.title' }}
+{% endblock %}
 
 {% block body %}
   <div class="container d-flex flex-row justify-content-center">
     <div class="col-6">
-      <p class="alert">An email has been sent to {{ user.getEmail() }}. It contains an activation link you must click to activate your account.</p>
+      <p class="alert">
+        {{ 'registration.email_sent.text'|trans({'%userEmail%': user.getEmail()}) }}
+      </p>
     </div>
   </div>
 {% endblock %}
\ No newline at end of file
diff --git a/templates/reset_password/email.html.twig b/templates/reset_password/email.html.twig
index f1f5593..58c5de8 100644
--- a/templates/reset_password/email.html.twig
+++ b/templates/reset_password/email.html.twig
@@ -9,9 +9,9 @@
 </a>
 
 <p>
-    {{ 'email_reset_password.link_expire'|trans({'%expirationDuration%': (resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle'))}) }}.
+    {{ 'general.link_expire'|trans({'%expirationDuration%': (resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle'))}) }}.
 </p>
 
 <p>
-    {{ 'email_reset_password.greeting'|trans }}
+    {{ 'general.greeting'|trans }}
 </p>
diff --git a/tests/functional/RegistrationControllerTest.php b/tests/functional/RegistrationControllerTest.php
index 85fca77..3095ea1 100644
--- a/tests/functional/RegistrationControllerTest.php
+++ b/tests/functional/RegistrationControllerTest.php
@@ -177,7 +177,7 @@ class RegistrationControllerTest extends WebTestCase
     {
         /** @phpstan-ignore-next-line */
         $crawler = new Crawler($emailMessage->getHtmlBody());
-        $crawlerLink = $crawler->selectLink('Confirm my Email')->link();
+        $crawlerLink = $crawler->selectLink('Confirm my email')->link();
         $client->click($crawlerLink);
     }
 
diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml
index a2c55b3..4e8a7ae 100644
--- a/translations/messages.en.yaml
+++ b/translations/messages.en.yaml
@@ -4,6 +4,8 @@ general:
   sign_in: Sign in
   log_out: Log out
   go_back_to_home_page: Home page
+  link_expire: This link will expire in %expirationDuration%
+  greeting: Cheers!
 
 login:
   account_disabled_feedback: Your user account is disabled. Please click on the link your receive by email to validate your registration.
@@ -20,6 +22,13 @@ registration:
     agreeTerms: Accept terms and conditions
     register: Register
     email_verified_success: Your email address has been verified
+    email_sent:
+      title: Mail registration sent
+      text: An email has been sent to %userEmail%. It contains an activation link you must click to activate your account
+    email:
+      title: Hi! Please confirm your email
+      text: Please confirm your email address to activate MemoRekall account by clicking the following link
+      confirm_email: Confirm my email
 
 reset_password:
   title: Reset your password
@@ -31,9 +40,10 @@ reset_password:
 email:
   address_verified: Your email address has been verified
 
+
 check_email_reset_password:
   title: Password Reset Email Sent
-  text: If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password.
+  text: If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password
     This link will expire in %expirationDuration%
   check_spam: If you don't receive an email please check your spam folder or
   try_again: Try again.
@@ -41,8 +51,6 @@ check_email_reset_password:
 email_reset_password:
   instructions: To reset your password, please visit the following link
   link: Reset my password
-  link_expire: This link will expire in %expirationDuration%
-  greeting: Cheers!
 
 capsule:
   title: My capsules
diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml
index 9ac0296..3bfa7fb 100644
--- a/translations/messages.fr.yaml
+++ b/translations/messages.fr.yaml
@@ -3,6 +3,8 @@ general:
   password: Mot de passe
   sign_in: Se connecter
   log_out: Se déconnecter
+  link_expire: Le lien expirera dans
+  greeting: Salutation !
 
 login:
   account_disabled_feedback: Le compte utilisateur a été désactivé. Veuillez cliquer sur le lien pour recevoir un courriel de validation
@@ -17,8 +19,15 @@ registration:
     second: Répéter le mot de passe
   captcha: Captcha
   agreeTerms: Accepter les termes et conditions
-  register: S'enregistrer
-  email_verified_success: Votre courriel a été vérifié
+  register: Créer un compte
+  email_verified_success: Votre adresse email a été vérifiée
+  email_sent:
+    title: E-mail de création de compte envoyé
+    text: Nous avons envoyé un courriel à l'adresse e-mail %userEmail%. Il contient un lien d'activation sur lequel vous devez cliquer pour activer votre compte
+  email:
+    title: Bonjour ! Veuillez confirmer votre adresse email
+    text: Veuillez confirmer votre adresse e-mail pour activer votre compte MemoRekall en cliquant sur le lien suivant
+    confirm_email: Confirmer mon adresse e-mail
 
 reset_password:
   title: Réinitialiser mon mot de passe
@@ -40,8 +49,6 @@ check_email_reset_password:
 email_reset_password:
   instructions: Pour réinitialiser le mot de passe, veuillez cliquer sur le lien suivant
   link: Réinitialiser mon mot de passe
-  link_expire: Le lien expirera dans
-  greeting: Salutation !
 
 capsule:
   title: Mes capsules
-- 
GitLab