From 6eb072e69fa86546a0c0a06fcc1120a554d2ee9d Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Thu, 26 Aug 2021 12:40:20 +0200 Subject: [PATCH] feat(i18n): translate email greetings --- .../devise_mailer/confirmation_instructions.en.html.haml | 6 ++---- app/views/devise_mailer/confirmation_instructions.html.haml | 6 ++---- app/views/devise_mailer/email_changed.en.html.haml | 3 +-- app/views/devise_mailer/email_changed.html.haml | 3 +-- app/views/devise_mailer/password_change.en.html.haml | 3 +-- app/views/devise_mailer/password_change.html.haml | 3 +-- .../devise_mailer/reset_password_instructions.en.html.haml | 3 +-- .../devise_mailer/reset_password_instructions.html.haml | 3 +-- app/views/devise_mailer/unlock_instructions.en.html.haml | 3 +-- app/views/devise_mailer/unlock_instructions.html.haml | 3 +-- .../notify_automatic_deletion_to_administration.html.haml | 3 +-- .../notify_automatic_deletion_to_user.html.haml | 3 +-- .../dossier_mailer/notify_brouillon_deletion.html.haml | 3 +-- .../dossier_mailer/notify_brouillon_near_deletion.html.haml | 3 +-- .../dossier_mailer/notify_brouillon_not_submitted.html.haml | 3 +-- .../notify_deletion_to_administration.html.haml | 3 +-- app/views/dossier_mailer/notify_deletion_to_user.html.haml | 3 +-- .../notify_groupe_instructeur_changed.html.haml | 2 ++ .../notify_instructeur_deletion_to_user.html.haml | 3 +-- .../notify_near_deletion_to_administration.html.haml | 3 +-- .../dossier_mailer/notify_near_deletion_to_user.html.haml | 3 +-- app/views/dossier_mailer/notify_new_answer.html.haml | 3 +-- .../notify_new_commentaire_to_instructeur.html.haml | 3 +-- .../notify_new_dossier_depose_to_instructeur.html.haml | 3 +-- app/views/dossier_mailer/notify_new_draft.en.html.haml | 3 +-- app/views/dossier_mailer/notify_new_draft.html.haml | 3 +-- .../dossier_mailer/notify_revert_to_instruction.html.haml | 3 +-- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + 29 files changed, 32 insertions(+), 56 deletions(-) diff --git a/app/views/devise_mailer/confirmation_instructions.en.html.haml b/app/views/devise_mailer/confirmation_instructions.en.html.haml index ec5d38fd4..63f5525bb 100644 --- a/app/views/devise_mailer/confirmation_instructions.en.html.haml +++ b/app/views/devise_mailer/confirmation_instructions.en.html.haml @@ -2,8 +2,7 @@ - if @user.unconfirmed_email.nil? - content_for(:title, 'Activate account') - %p - Dear Sir or Madam, + %p= t(:greeting, scope: [:layouts, :signature]) %p You have entered your details to create an account on #{APPLICATION_NAME}. To confirm your email and finish creating your account, select the following link: @@ -13,8 +12,7 @@ - else - content_for(:title, "Change email address") - %p - Dear Sir or Madam, + %p= t(:greeting, scope: [:layouts, :signature]) %p To confirm your account email change on #{APPLICATION_NAME}, select the following link: diff --git a/app/views/devise_mailer/confirmation_instructions.html.haml b/app/views/devise_mailer/confirmation_instructions.html.haml index 25710acc4..1c091764f 100644 --- a/app/views/devise_mailer/confirmation_instructions.html.haml +++ b/app/views/devise_mailer/confirmation_instructions.html.haml @@ -2,8 +2,7 @@ - if @user.unconfirmed_email.nil? - content_for(:title, 'Activez votre compte') - %p - Bonjour, + %p= t(:greeting, scope: [:layouts, :signature]) %p Pour activer votre compte sur #{APPLICATION_NAME}, veuillez cliquer sur le lien suivant : @@ -13,8 +12,7 @@ - else - content_for(:title, "Changement d’adresse email") - %p - Bonjour, + %p= t(:greeting, scope: [:layouts, :signature]) %p Pour confirmer votre changement d’adresse email, veuillez cliquer sur le lien suivant : diff --git a/app/views/devise_mailer/email_changed.en.html.haml b/app/views/devise_mailer/email_changed.en.html.haml index 644a59424..e60c5bc43 100644 --- a/app/views/devise_mailer/email_changed.en.html.haml +++ b/app/views/devise_mailer/email_changed.en.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'New email address') -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) - unconfirmed_email = @resource.try(:unconfirmed_email?) - if unconfirmed_email.present? diff --git a/app/views/devise_mailer/email_changed.html.haml b/app/views/devise_mailer/email_changed.html.haml index e8db96fe0..51ba99204 100644 --- a/app/views/devise_mailer/email_changed.html.haml +++ b/app/views/devise_mailer/email_changed.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Votre nouvelle adresse email') -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) - unconfirmed_email = @resource.try(:unconfirmed_email?) - if unconfirmed_email.present? diff --git a/app/views/devise_mailer/password_change.en.html.haml b/app/views/devise_mailer/password_change.en.html.haml index 1cdfac54d..845357aed 100644 --- a/app/views/devise_mailer/password_change.en.html.haml +++ b/app/views/devise_mailer/password_change.en.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'New password') -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p A request to change your password on #{APPLICATION_NAME} for the account #{@resource.email} was successfully processed. diff --git a/app/views/devise_mailer/password_change.html.haml b/app/views/devise_mailer/password_change.html.haml index 02c297634..0a4531a3e 100644 --- a/app/views/devise_mailer/password_change.html.haml +++ b/app/views/devise_mailer/password_change.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Votre nouveau mot de passe') -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p La demande de changement de mot de passe pour votre compte #{@resource.email} sur diff --git a/app/views/devise_mailer/reset_password_instructions.en.html.haml b/app/views/devise_mailer/reset_password_instructions.en.html.haml index be27aee1a..774610c4a 100644 --- a/app/views/devise_mailer/reset_password_instructions.en.html.haml +++ b/app/views/devise_mailer/reset_password_instructions.en.html.haml @@ -1,5 +1,4 @@ -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p Someone has requested to change your account password on #{APPLICATION_NAME}. To define a new password, select the following link: diff --git a/app/views/devise_mailer/reset_password_instructions.html.haml b/app/views/devise_mailer/reset_password_instructions.html.haml index 051a5d054..72db8073d 100644 --- a/app/views/devise_mailer/reset_password_instructions.html.haml +++ b/app/views/devise_mailer/reset_password_instructions.html.haml @@ -1,5 +1,4 @@ -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Vous avez demandé à changer votre mot de passe sur #{APPLICATION_NAME}. Pour ceci, merci de cliquer sur le lien suivant : diff --git a/app/views/devise_mailer/unlock_instructions.en.html.haml b/app/views/devise_mailer/unlock_instructions.en.html.haml index ead124008..092071373 100644 --- a/app/views/devise_mailer/unlock_instructions.en.html.haml +++ b/app/views/devise_mailer/unlock_instructions.en.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Reactivate account') -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p Someone made too many unsuccessful attempts to connect to your account #{@resource.email} on #{APPLICATION_NAME}. diff --git a/app/views/devise_mailer/unlock_instructions.html.haml b/app/views/devise_mailer/unlock_instructions.html.haml index 123009049..5f883f21e 100644 --- a/app/views/devise_mailer/unlock_instructions.html.haml +++ b/app/views/devise_mailer/unlock_instructions.html.haml @@ -1,7 +1,6 @@ - content_for(:title, 'Réactivez votre compte') -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Quelqu’un a tenté de se connecter un grand nombre de fois sans succès à votre diff --git a/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml index 373b78d11..042d4916d 100644 --- a/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_automatic_deletion_to_administration.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @deleted_dossiers.count) diff --git a/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml index bf35cabe2..e3264eec3 100644 --- a/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_automatic_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @deleted_dossiers.count) diff --git a/app/views/dossier_mailer/notify_brouillon_deletion.html.haml b/app/views/dossier_mailer/notify_brouillon_deletion.html.haml index a621b7009..a7af936c2 100644 --- a/app/views/dossier_mailer/notify_brouillon_deletion.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_deletion.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @dossier_hashes.count) diff --git a/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml b/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml index bce0ad8dc..3c9e3389d 100644 --- a/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_near_deletion.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.header', count: @dossiers.count) diff --git a/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml b/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml index dfc1f4610..ac0ca1042 100644 --- a/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml +++ b/app/views/dossier_mailer/notify_brouillon_not_submitted.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Le dossier n°#{@dossier.id} pour la démarche «  diff --git a/app/views/dossier_mailer/notify_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_deletion_to_administration.html.haml index e64cab4b6..f95a80e08 100644 --- a/app/views/dossier_mailer/notify_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_deletion_to_administration.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @deleted_dossier.dossier_id, procedure: @deleted_dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_deletion_to_user.html.haml index e64cab4b6..f95a80e08 100644 --- a/app/views/dossier_mailer/notify_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @deleted_dossier.dossier_id, procedure: @deleted_dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml b/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml index f87c675f9..bc04bc8e6 100644 --- a/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml +++ b/app/views/dossier_mailer/notify_groupe_instructeur_changed.html.haml @@ -1,5 +1,7 @@ - content_for(:title, "#{@subject}") +%p= t(:greeting, scope: [:layouts, :signature]) + %p = "Vous suiviez jusqu'à maintenant le dossier n°#{@dossier_id} de la démarche #{@demarche}." L’usager a modifié le groupe de routage. Son dossier appartient maintenant à un groupe instructeur dont vous ne faites pas partie. diff --git a/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml index 0dde82206..2031e390c 100644 --- a/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_instructeur_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body_html', dossier_id: @deleted_dossier.dossier_id, libelle_demarche: @deleted_dossier.procedure.libelle, deleted_dossiers_link: dossiers_url(statut: 'dossiers-supprimes')) diff --git a/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml b/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml index 485757f6d..af16fd23c 100644 --- a/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml +++ b/app/views/dossier_mailer/notify_near_deletion_to_administration.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p - if @state == Dossier.states.fetch(:en_construction) diff --git a/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml b/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml index a4af7f504..3813ea154 100644 --- a/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml +++ b/app/views/dossier_mailer/notify_near_deletion_to_user.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p - if @state == Dossier.states.fetch(:en_construction) diff --git a/app/views/dossier_mailer/notify_new_answer.html.haml b/app/views/dossier_mailer/notify_new_answer.html.haml index de623db62..e8397babe 100644 --- a/app/views/dossier_mailer/notify_new_answer.html.haml +++ b/app/views/dossier_mailer/notify_new_answer.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) - if !@dossier.brouillon? %p diff --git a/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml b/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml index cfb294aa6..85060326a 100644 --- a/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml +++ b/app/views/dossier_mailer/notify_new_commentaire_to_instructeur.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml b/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml index 1d05aa596..fd3c4e2a8 100644 --- a/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml +++ b/app/views/dossier_mailer/notify_new_dossier_depose_to_instructeur.html.haml @@ -1,7 +1,6 @@ - content_for(:title, "#{@subject}") -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p = t('.body', dossier_id: @dossier.id, libelle_demarche: @dossier.procedure.libelle) diff --git a/app/views/dossier_mailer/notify_new_draft.en.html.haml b/app/views/dossier_mailer/notify_new_draft.en.html.haml index f3e6b1e8f..8d6a2404a 100644 --- a/app/views/dossier_mailer/notify_new_draft.en.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.en.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Dear Sir or Madam, +%p= t(:greeting, scope: [:layouts, :signature]) %p You started filling a File on the procedure: diff --git a/app/views/dossier_mailer/notify_new_draft.html.haml b/app/views/dossier_mailer/notify_new_draft.html.haml index 4553738bf..2a6c8ce5b 100644 --- a/app/views/dossier_mailer/notify_new_draft.html.haml +++ b/app/views/dossier_mailer/notify_new_draft.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Vous avez commencé à remplir un dossier pour la démarche diff --git a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml index f5b8caa5e..4f0388899 100644 --- a/app/views/dossier_mailer/notify_revert_to_instruction.html.haml +++ b/app/views/dossier_mailer/notify_revert_to_instruction.html.haml @@ -1,8 +1,7 @@ - content_for :procedure_logo do = render 'layouts/mailers/logo', url: @logo_url -%p - Bonjour, +%p= t(:greeting, scope: [:layouts, :signature]) %p Votre dossier va être réexaminé, la précédente décision sur ce dossier est caduque. diff --git a/config/locales/en.yml b/config/locales/en.yml index 7afc13b1f..6f544e646 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -54,6 +54,7 @@ en: locale_dropdown: languages: "Languages" signature: + greeting: Dear Sir or Madam, best_regards: Best Regards, views: commencer: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e446339a3..6daa7d7ab 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -44,6 +44,7 @@ fr: locale_dropdown: languages: "Langues" signature: + greeting: Bonjour, best_regards: Bonne journée, views: commencer: