From a5750ed4cee677e454312a8e504b7dbc4d7c3f5e Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Fri, 20 Aug 2021 10:44:58 +0200 Subject: [PATCH] i18n for registration page --- app/views/users/registrations/new.html.haml | 18 +++++++++--------- config/locales/en.yml | 8 ++++++++ config/locales/fr.yml | 9 +++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/app/views/users/registrations/new.html.haml b/app/views/users/registrations/new.html.haml index ec7b91c30..1d1c5d58e 100644 --- a/app/views/users/registrations/new.html.haml +++ b/app/views/users/registrations/new.html.haml @@ -3,27 +3,27 @@ .auth-form = devise_error_messages! = form_for resource, url: user_registration_path, html: { class: "form" } do |f| - %h1 Créez-vous un compte #{APPLICATION_NAME} + %h1= t('views.registrations.new.title', name: APPLICATION_NAME) = render partial: 'shared/france_connect_login', locals: { url: france_connect_particulier_path } - = f.label :email, "Email (nom@site.com)", id: :user_email_label - = f.text_field :email, type: :email, autocomplete: 'email', autofocus: true, placeholder: "Votre adresse email", 'aria-describedby': :user_email_label + = f.label :email, t('views.registrations.new.email_label'), id: :user_email_label + = f.text_field :email, type: :email, autocomplete: 'email', autofocus: true, placeholder: t('views.registrations.new.email_placeholder'), 'aria-describedby': :user_email_label .suspect-email.hidden .email-suggestion-title - Voulez-vous dire + = t('views.registrations.new.wanna_say') %span.email-suggestion-address blabla@gmail.com  ? .email-suggestion-answer = button_tag type: 'button', class: 'button small', onclick: "DS.acceptEmailSuggestion()" do - Oui + = t('simple_form.yes') = button_tag type: 'button', class: 'button small', onclick: "DS.discardEmailSuggestionBox()" do - Non + = t('simple_form.no') - = f.label :password, "Mot de passe (#{PASSWORD_MIN_LENGTH} caractères minimum)", id: :user_password_label - = f.password_field :password, autocomplete: 'new-password', value: @user.password, placeholder: "#{PASSWORD_MIN_LENGTH} caractères minimum", 'aria-describedby': :user_password_label + = f.label :password, t('views.registrations.new.password_label', min_length: PASSWORD_MIN_LENGTH), id: :user_password_label + = f.password_field :password, autocomplete: 'new-password', value: @user.password, placeholder: t('views.registrations.new.password_placeholder', min_length: PASSWORD_MIN_LENGTH), 'aria-describedby': :user_password_label - = f.submit "Créer un compte", class: "button large primary expand" + = f.submit t('views.shared.account.create'), class: "button large primary expand" diff --git a/config/locales/en.yml b/config/locales/en.yml index 899b797c8..fbb5921ec 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -60,6 +60,14 @@ en: show_my_submitted_file: 'Show my submitted file' want_empty_pdf: "You prefer to submit a paper form? You can download an empty PDF file, and send it to the right administration : %{service} - %{adresse}" download_empty_pdf: 'Download an empty PDF file' + registrations: + new: + title: "Create an account %{name}" + email_label: 'Email (name@site.com)' + email_placeholder: 'Your email address' + wanna_say: 'Do you mean to say' + password_label: "Password (%{min_length} characters minimum)" + password_placeholder: "%{min_length} characters minimum" invites: dropdown: invite_to_edit: Invite someone to edit this file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e96f03d17..3649d2bb5 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -49,6 +49,15 @@ fr: show_my_submitted_file: 'Voir mon dossier déposé' want_empty_pdf: "Vous souhaitez effectuer une demande par papier ? Vous pouvez télécharger un dossier vide au format PDF, et l'envoyer à l’administration concernée : %{service} - %{adresse}" download_empty_pdf: 'Télécharger un dossier vide au format PDF' + registrations: + new: + title: "Créez-vous un compte %{name}" + email_label: 'Email (nom@site.com)' + email_placeholder: 'Votre adresse email' + wanna_say: 'Voulez-vous dire' + password_label: "Mot de passe (%{min_length} caractères minimum)" + password_placeholder: "%{min_length} caractères minimum" + invites: dropdown: