diff --git a/src/Form/RegistrationFormType.php b/src/Form/RegistrationFormType.php index cabe1d492809ef7bcba2a2f9e6e480641f0bb15c..69859796fdead619aafc11559558a1798df6cb86 100644 --- a/src/Form/RegistrationFormType.php +++ b/src/Form/RegistrationFormType.php @@ -44,7 +44,7 @@ class RegistrationFormType extends AbstractType EmailType::class, [ 'constraints' => [new NotBlank(['message' => 'email.not_blank'])], - 'label' => 'registration.email' + 'label' => 'general.email' ] ) ->add('plainPassword', RepeatedType::class, [ diff --git a/src/Form/ResetPasswordRequestFormType.php b/src/Form/ResetPasswordRequestFormType.php index 706ba84e8ca214659f4fe4590029af2323428d64..357216514100f2c4fd7285f1fb09f6891376f8e1 100644 --- a/src/Form/ResetPasswordRequestFormType.php +++ b/src/Form/ResetPasswordRequestFormType.php @@ -20,7 +20,7 @@ class ResetPasswordRequestFormType extends AbstractType 'message' => 'email.not_blank', ]), ], - 'label' => 'reset_password.email' + 'label' => 'general.email' ]) ; } diff --git a/templates/connexion.html.twig b/templates/connexion.html.twig index d53a065861964802eeb43e568e7d4aee00d58edc..caa9374a3dd7cba009af48f6d2ca6232b9e1c0af 100644 --- a/templates/connexion.html.twig +++ b/templates/connexion.html.twig @@ -2,7 +2,11 @@ {% block connexion %} <div class="d-flex flex-row justify-content-center mb-10"> - <a href="/login" class="btn btn-primary m-2 px-4 py-3" >LOG IN</a> - <a href="/register" class="btn btn-primary m-2 px-4 py-3" >SIGN IN</a> + <a href="/login" class="btn btn-primary m-2 px-4 py-3 text-uppercase" > + {{ 'login.log_in'|trans }} + </a> + <a href="/register" class="btn btn-primary m-2 px-4 py-3 text-uppercase"> + {{ 'general.sign_in'|trans }} + </a> </div> {% endblock %} diff --git a/templates/layout.html.twig b/templates/layout.html.twig index 758ed75fcbac52968ce17c1380aa18f9ed8a27f0..999ce4f546b16e33c28b24b890d1d06e656b5d34 100644 --- a/templates/layout.html.twig +++ b/templates/layout.html.twig @@ -3,8 +3,7 @@ <head> <meta charset="UTF-8"> <title>{% block title %}MemoRekall{% endblock %}</title> - {# Run `composer require symfony/webpack-encore-bundle` - and uncomment the following Encore helpers to start using Symfony UX #} + {% block stylesheets %} {{ encore_entry_link_tags('app') }} {% endblock %} @@ -27,7 +26,9 @@ <div id="user-block"> <div id="user-block-nom">{{ app.user.firstName }} {{ app.user.lastName }}</div> <form> - <button class="btn btn-primary" formaction="/logout">Log out</button> + <button class="btn btn-primary" formaction="/logout"> + {{ 'general.log_out'|trans }} + </button> </form> </div> {% endif %} diff --git a/templates/reset_password/check_email.html.twig b/templates/reset_password/check_email.html.twig index 1522a61be69ec1addea3693a4cc3720439d964e6..5dda4cb2003f84cb607ad87f842110eadbd96c83 100644 --- a/templates/reset_password/check_email.html.twig +++ b/templates/reset_password/check_email.html.twig @@ -1,11 +1,17 @@ {% extends 'layout.html.twig' %} -{% block title %}Password Reset Email Sent{% endblock %} +{% block title %} + {{ 'check_email_reset_password.title'|trans }} +{% endblock %} {% block body %} <p> - 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 {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}. + {{ 'check_email_reset_password.text'|trans }} + {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}. + </p> + <p>{{ 'check_email_reset_password.check_spam'|trans }} + <a href="{{ path('app_forgot_password_request') }}"> + {{ 'check_email_reset_password.try_again'|trans }} + </a> </p> - <p>If you don't receive an email please check your spam folder or <a href="{{ path('app_forgot_password_request') }}">try again</a>.</p> {% endblock %} diff --git a/templates/reset_password/email.html.twig b/templates/reset_password/email.html.twig index 7b470f35d5f51cfb85a6770028874416a525d6ae..eb11e2a1f020095af03649bac6a30f16d4d5d641 100644 --- a/templates/reset_password/email.html.twig +++ b/templates/reset_password/email.html.twig @@ -1,9 +1,17 @@ <h1>Hi!</h1> -<p>To reset your password, please visit the following link</p> +<p> + {{ 'email_reset_password.instructions'|trans }} +</p> -<a href="{{ url('app_reset_password', {token: resetToken.token}) }}">Reset my password</a> +<a href="{{ url('app_reset_password', {token: resetToken.token}) }}"> + {{ 'email_reset_password.link'|trans }} +</a> -<p>This link will expire in {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}.</p> +<p> + {{ 'email_reset_password.link_expire'|trans }} {{ resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') }}. +</p> -<p>Cheers!</p> +<p> + {{ 'email_reset_password.greeting'|trans }} +</p> diff --git a/templates/reset_password/request.html.twig b/templates/reset_password/request.html.twig index 24b35096556e70b28cd7f89636cb1dcf7723a1f8..5cc417ed4effa88f1af6b0f904f400040a83fcc7 100644 --- a/templates/reset_password/request.html.twig +++ b/templates/reset_password/request.html.twig @@ -1,12 +1,16 @@ {% extends 'layout.html.twig' %} -{% block title %}Reset your password{% endblock %} +{% block title %} + {{ 'reset_password.title'|trans }} +{% endblock %} {% block body %} {% for flashError in app.flashes('reset_password_error') %} <div class="alert alert-danger" role="alert">{{ flashError }}</div> {% endfor %} - <h1 class="m-auto mb-4 mt-4 col-6">Reset your password</h1> + <h1 class="m-auto mb-4 mt-4 col-6"> + {{ 'reset_password.title'|trans }} + </h1> <div class="d-flex flex-column justify-content-center"> @@ -17,12 +21,13 @@ <div class="m-auto mb-4 mt-4 col-6"> <small> - Enter your email address and we will send you a - link to reset your password. + {{ 'reset_password.message'|trans }} </small> </div> - <button class="d-flex flex-column btn btn-primary m-auto mt-2 mb-4 col-2" type="submit">Reset password</button> + <button class="d-flex flex-column btn btn-primary m-auto mt-2 mb-4 col-2" type="submit"> + {{ 'reset_password.button'|trans }} + </button> {{ form_end(requestForm) }} </div> diff --git a/templates/reset_password/reset.html.twig b/templates/reset_password/reset.html.twig index b97a360e3fb31418d6d87de71ad8d82094b0d1f3..820aca2ca2f5a1087bafcd5858963b1c4770e585 100644 --- a/templates/reset_password/reset.html.twig +++ b/templates/reset_password/reset.html.twig @@ -1,9 +1,13 @@ {% extends 'layout.html.twig' %} -{% block title %}Reset your password{% endblock %} +{% block title %} + {{ 'reset_password.title'|trans }} +{% endblock %} {% block body %} - <h1 class="m-auto mb-4 col-6">Reset your password</h1> + <h1 class="m-auto mb-4 col-6"> + {{ 'reset_password.title'|trans }} + </h1> <div class="d-flex flex-column justify-content-center"> {{ form_start(resetForm, {'attr': {novalidate: 'novalidate'}}) }} @@ -11,7 +15,7 @@ {{ form_row(resetForm.plainPassword) }} </div> <button class="d-flex flex-column btn btn-primary m-auto mt-2 mb-4 col-2" type="submit"> - Reset password + {{ 'reset_password.button'|trans }} </button> {{ form_end(resetForm) }} </div> diff --git a/templates/security/login.html.twig b/templates/security/login.html.twig index cfcfb43365db125bc59699ab68fc8ff3cbe20675..4aef930062105df37d2b457af1aa1e3bf24a8eee 100644 --- a/templates/security/login.html.twig +++ b/templates/security/login.html.twig @@ -1,6 +1,8 @@ {% extends 'connexion.html.twig' %} -{% block title %}Log in{% endblock %} +{% block title %} + {{ 'login.log_in'|trans }} +{% endblock %} {% block body %} <form method="post" class="d-flex flex-column justify-content-center"> @@ -11,18 +13,16 @@ <div class="alert alert-warning col-6 m-auto" role="alert" >{{ flashMessage }}</div> {% endfor %} - {% if app.user %} - <div class="mb-3"> - You are logged in as {{ app.user.username }}, <a href="{{ path('app_logout') }}">Logout</a> - </div> - {% endif %} - <div class="form-group d-flex flex-column m-auto mb-4 mt-4 col-6"> - <label for="inputEmail" class="form-label">Email</label> + <label for="inputEmail" class="form-label"> + {{ 'general.email'|trans }} + </label> <input type="email" value="{{ last_username }}" name="email" id="inputEmail" class="form-control" autocomplete="email" required autofocus> </div> <div class="form-group d-flex flex-column m-auto mb-4 col-6"> - <label for="inputPassword" class="form-label">Password</label> + <label for="inputPassword" class="form-label"> + {{ 'general.password'|trans }} + </label> <input type="password" name="password" id="inputPassword" class="form-control" autocomplete="current-password" required> </div> @@ -41,10 +41,12 @@ </div> #} - <a href="/reset-password" class="m-auto">I forgot my password</a> + <a href="/reset-password" class="m-auto"> + {{ 'login.forgot_password_link'|trans }} + </a> <button class="btn btn-primary col-2 m-auto mt-4" type="submit"> - Log in + {{ 'login.log_in'|trans }} </button> </form> diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index 9cb783643734136adcd6ba951c0cf61d4d841432..be3a7d71b8632264c2d3ca39bf446e1c5039dd2a 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -1,10 +1,17 @@ +general: + email: Email + password: Password + sign_in: Sign in + log_out: Log out + login: account_disabled_feedback: Your user account is disabled. Please click on the link your receive by email to validate your registration. + forgot_password_link: I forgot my password + log_in: Log in registration: firstName: First name lastName: Last name - email: Email password: first: Password second: Repeat Password @@ -12,7 +19,23 @@ registration: agreeTerms: Accept terms and conditions register: Register +#RESET PASSWORD reset_password: - email: Email + title: Reset your password + new_password: New password repeat_password: Repeat password - new_password: New password \ No newline at end of file + message: Enter your email address and we will send you a link to reset your password. + button: Reset password + +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. + This link will expire in + check_spam: If you don't receive an email please check your spam folder or + try_again: Try again. + +email_reset_password: + instructions: To reset your password, please visit the following link + link: Reset my password + link_expire: This link will expire in + greeting: Cheers! \ No newline at end of file