From a5750ed4cee677e454312a8e504b7dbc4d7c3f5e Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Fri, 20 Aug 2021 10:44:58 +0200 Subject: [PATCH 1/2] 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: From 99c16e8dc03b0d8a3f5bb9731cbc37e92dad518c Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Fri, 20 Aug 2021 10:52:01 +0200 Subject: [PATCH 2/2] i18n for header --- app/views/layouts/_header.haml | 4 ++-- app/views/shared/help/_help_button.html.haml | 2 +- config/locales/en.yml | 1 + config/locales/fr.yml | 1 + config/locales/views/shared/en.yml | 2 ++ config/locales/views/shared/fr.yml | 2 ++ 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_header.haml b/app/views/layouts/_header.haml index 80e64b4d5..1cc645e27 100644 --- a/app/views/layouts/_header.haml +++ b/app/views/layouts/_header.haml @@ -65,9 +65,9 @@ - elsif request.path != new_user_session_path - if request.path == new_user_registration_path %li - Vous avez déjà un compte ? + = t('views.shared.account.already_user_question') %li - = link_to "Connexion", new_user_session_path, class: "button secondary" + = link_to t('views.shared.account.signin'), new_user_session_path, class: "button secondary" %li - if dossier.present? && nav_bar_profile == :user diff --git a/app/views/shared/help/_help_button.html.haml b/app/views/shared/help/_help_button.html.haml index a73a69381..7b782036c 100644 --- a/app/views/shared/help/_help_button.html.haml +++ b/app/views/shared/help/_help_button.html.haml @@ -1 +1 @@ -= link_to 'Aide', FAQ_URL, class: 'button primary' += link_to t('help'), FAQ_URL, class: 'button primary' diff --git a/config/locales/en.yml b/config/locales/en.yml index fbb5921ec..79733ad87 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,6 +30,7 @@ # available at http://guides.rubyonrails.org/i18n.html. en: + help: 'Help' utils: deconnexion: "Log out" pj: "Attachments" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 3649d2bb5..6e1b0fdf9 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -20,6 +20,7 @@ # available at http://guides.rubyonrails.org/i18n.html. fr: + help: 'Aide' utils: deconnexion: "Déconnexion" pj: "Pièces jointes" diff --git a/config/locales/views/shared/en.yml b/config/locales/views/shared/en.yml index 896b668f6..e79a9aae2 100644 --- a/config/locales/views/shared/en.yml +++ b/config/locales/views/shared/en.yml @@ -8,5 +8,7 @@ en: help_link: What is FranceConnect? separator: or account: + already_user_question: 'Do you already have an account?' already_user: "I already have an account" create: 'Create an account' + signin: 'Sign in' diff --git a/config/locales/views/shared/fr.yml b/config/locales/views/shared/fr.yml index b56cb8783..29d6b9f4b 100644 --- a/config/locales/views/shared/fr.yml +++ b/config/locales/views/shared/fr.yml @@ -16,5 +16,7 @@ fr: help_link: "Qu’est-ce que FranceConnect ?" separator: 'ou' account: + already_user_question: 'Vous avez déjà un compte ?' already_user: 'J’ai déjà un compte' create: 'Créer un compte' + signin: 'Connexion'