From 580ae1c0639c5b930dfbcbb8ca2c81eca2e4a322 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 13:50:21 -0500 Subject: [PATCH 1/8] i18n: add automated check for inconsistent interpolations --- config/locales/views/dossier_mailer/notify_new_answer/fr.yml | 2 +- .../views/dossier_mailer/notify_revert_to_instruction/fr.yml | 2 +- lib/tasks/lint.rake | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/locales/views/dossier_mailer/notify_new_answer/fr.yml b/config/locales/views/dossier_mailer/notify_new_answer/fr.yml index 334ed7fad..4e6205abd 100644 --- a/config/locales/views/dossier_mailer/notify_new_answer/fr.yml +++ b/config/locales/views/dossier_mailer/notify_new_answer/fr.yml @@ -3,7 +3,7 @@ fr: notify_new_answer: subject: Nouveau message pour votre dossier nº %{dossier_id} « %{libelle_demarche} » body_html: | - Vous avez reçu un nouveau message de la part du service en charge de votre dossier. + Vous avez reçu un nouveau message de la part du service en charge de votre dossier sur la démarche « %{libelle_demarche} ». link: | Pour consulter le message et y répondre, cliquez sur le bouton ci-dessous : body_draft_html: | diff --git a/config/locales/views/dossier_mailer/notify_revert_to_instruction/fr.yml b/config/locales/views/dossier_mailer/notify_revert_to_instruction/fr.yml index bf26477c2..4607687e6 100644 --- a/config/locales/views/dossier_mailer/notify_revert_to_instruction/fr.yml +++ b/config/locales/views/dossier_mailer/notify_revert_to_instruction/fr.yml @@ -3,7 +3,7 @@ fr: notify_revert_to_instruction: subject: Votre dossier nº %{dossier_id} sur la démarche « %{libelle_demarche} » est en train d’être réexaminé body_html: | - Votre dossier va être réexaminé, la précédente décision sur ce dossier est caduque. + Votre dossier nº %{dossier_id} va être réexaminé, la précédente décision sur ce dossier est caduque. Vous pouvez retrouver le dossier que vous avez créé pour la démarche « %{libelle_demarche} » à l'adresse suivante : contact: | Pour obtenir le détail de cette modification de la décision, vous pouvez contacter par email : diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake index ee14d14e6..348f8079c 100644 --- a/lib/tasks/lint.rake +++ b/lib/tasks/lint.rake @@ -3,6 +3,7 @@ task :lint do sh "bundle exec haml-lint app/views/" sh "bundle exec scss-lint app/assets/stylesheets/" sh "bundle exec i18n-tasks missing --locales fr" + sh "bundle exec i18n-tasks check-consistent-interpolations" sh "bundle exec brakeman --no-pager" sh "yarn lint:js" end From f050a4757a80e652e26c5b457bc4563b3c91098d Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 14:20:13 -0500 Subject: [PATCH 2/8] i18n-tasks: consider model names localizations as used --- config/i18n-tasks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index cf7eab633..d67f9c255 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -96,6 +96,7 @@ search: ## Consider these keys used: ignore_unused: +- 'activerecord.models.*' - 'activerecord.attributes.*' - 'activerecord.errors.*' - 'errors.messages.blank' From 8748b6f4949e5f297a2bb2b2c458e1e3ae37b803 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 14:20:28 -0500 Subject: [PATCH 3/8] i18n-tasks: add hint for default_i18n_subject in mailers --- app/mailers/dossier_mailer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/mailers/dossier_mailer.rb b/app/mailers/dossier_mailer.rb index fb3dc35a6..7ae437fea 100644 --- a/app/mailers/dossier_mailer.rb +++ b/app/mailers/dossier_mailer.rb @@ -170,6 +170,8 @@ class DossierMailer < ApplicationMailer # This is an override of `default_i18n_subject` method # https://api.rubyonrails.org/v5.0.0/classes/ActionMailer/Base.html#method-i-default_i18n_subject + # + # i18n-tasks-use t("dossier_mailer.#{action}.subject") def default_i18n_subject(interpolations = {}) if interpolations[:state] mailer_scope = self.class.mailer_name.tr('/', '.') From 274b92c453e6f8e0deb87d1cacf4b370fcf01e47 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 14:20:49 -0500 Subject: [PATCH 4/8] i18n: remove simple_form locale files We don't even use simple_form. --- app/views/users/registrations/new.html.haml | 6 ++-- config/locales/en.yml | 2 ++ config/locales/fr.yml | 2 ++ config/locales/simple_form.en.yml | 31 --------------------- config/locales/simple_form.fr.yml | 31 --------------------- 5 files changed, 6 insertions(+), 66 deletions(-) delete mode 100644 config/locales/simple_form.en.yml delete mode 100644 config/locales/simple_form.fr.yml diff --git a/app/views/users/registrations/new.html.haml b/app/views/users/registrations/new.html.haml index 1d1c5d58e..6661623f2 100644 --- a/app/views/users/registrations/new.html.haml +++ b/app/views/users/registrations/new.html.haml @@ -17,13 +17,11 @@  ? .email-suggestion-answer = button_tag type: 'button', class: 'button small', onclick: "DS.acceptEmailSuggestion()" do - = t('simple_form.yes') + = t('utils.yes') = button_tag type: 'button', class: 'button small', onclick: "DS.discardEmailSuggestionBox()" do - = t('simple_form.no') + = t('utils.no') = 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 t('views.shared.account.create'), class: "button large primary expand" - - diff --git a/config/locales/en.yml b/config/locales/en.yml index ae210882e..4cf327266 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -32,6 +32,8 @@ en: help: 'Help' utils: + 'yes': Yes + 'no': No deconnexion: "Log out" pj: "Attachments" asterisk_html: Fields marked by an asterisk ( * ) are mandatory. diff --git a/config/locales/fr.yml b/config/locales/fr.yml index a74388d3f..6f50099de 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -22,6 +22,8 @@ fr: help: 'Aide' utils: + 'yes': Oui + 'no': Non deconnexion: "Déconnexion" pj: "Pièces jointes" asterisk_html: Les champs suivis d’un astérisque ( * ) sont obligatoires. diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml deleted file mode 100644 index 7f24a9bdc..000000000 --- a/config/locales/simple_form.en.yml +++ /dev/null @@ -1,31 +0,0 @@ -en: - simple_form: - "yes": 'Yes' - "no": 'No' - required: - text: 'required' - mark: '*' - # You can uncomment the line below if you need to overwrite the whole required html. - # When using html, text and mark won’t be used. - # html: '*' - error_notification: - default_message: "Please review the problems below:" - # Examples - # labels: - # defaults: - # password: 'Password' - # user: - # new: - # email: 'E-mail to sign in.' - # edit: - # email: 'E-mail.' - # hints: - # defaults: - # username: 'User name to sign in.' - # password: 'No special characters, please.' - # include_blanks: - # defaults: - # age: 'Rather not say' - # prompts: - # defaults: - # age: 'Select your age' diff --git a/config/locales/simple_form.fr.yml b/config/locales/simple_form.fr.yml deleted file mode 100644 index 73dbc13fc..000000000 --- a/config/locales/simple_form.fr.yml +++ /dev/null @@ -1,31 +0,0 @@ -fr: - simple_form: - "yes": 'Oui' - "no": 'Non' - required: - text: 'obligatoire' - mark: '*' - # You can uncomment the line below if you need to overwrite the whole required html. - # When using html, text and mark won't be used. - # html: '*' - error_notification: - default_message: "Erreur, veuillez vérifier vos réponses:" - # Examples - # labels: - # defaults: - # password: 'Password' - # user: - # new: - # email: 'E-mail to sign in.' - # edit: - # email: 'E-mail.' - # hints: - # defaults: - # username: 'User name to sign in.' - # password: 'No special characters, please.' - # include_blanks: - # defaults: - # age: 'Rather not say' - # prompts: - # defaults: - # age: 'Select your age' From ede23fa5429ddb40f316be1a248d1d21e51b4db8 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 22:28:03 -0500 Subject: [PATCH 5/8] i18n: remove unused locales about user feedback --- config/locales/en.yml | 1 - config/locales/fr.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 4cf327266..0224de480 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -186,7 +186,6 @@ en: status: "Status" updated: "Updated" actions: "Actions" - accessibility_question: "What do you think about the accessibility of this service?" dossier_action: edit_dossier: "Edit the file" start_other_dossier: "Start an other file" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 6f50099de..b586a116c 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -182,7 +182,6 @@ fr: status: "Statut" updated: "Mis à jour" actions: "Actions" - accessibility_question: "Que pensez-vous de la facilité d’utilisation de ce service ?" dossier_action: edit_dossier: "Modifier le dossier" start_other_dossier: "Commencer un autre dossier" From f9220891a79bd5cc70178e1f746b006b80ad9c3b Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 14:51:16 -0500 Subject: [PATCH 6/8] i18n: refactor user support locales This allow i18n-tasks to better detect dynamic keys. --- app/lib/helpscout/form_adapter.rb | 10 ++--- app/views/support/admin.html.haml | 2 +- app/views/support/index.html.haml | 17 ++++---- config/locales/views/support/en.yml | 50 +++++++++++++++++++++++ config/locales/views/support/fr.yml | 50 +++++++++++++++++++++++ config/locales/views/support/index.en.yml | 46 --------------------- config/locales/views/support/index.fr.yml | 46 --------------------- 7 files changed, 115 insertions(+), 106 deletions(-) create mode 100644 config/locales/views/support/en.yml create mode 100644 config/locales/views/support/fr.yml delete mode 100644 config/locales/views/support/index.en.yml delete mode 100644 config/locales/views/support/index.fr.yml diff --git a/app/lib/helpscout/form_adapter.rb b/app/lib/helpscout/form_adapter.rb index 4b073953c..937189305 100644 --- a/app/lib/helpscout/form_adapter.rb +++ b/app/lib/helpscout/form_adapter.rb @@ -3,11 +3,11 @@ class Helpscout::FormAdapter def self.options [ - [I18n.t(TYPE_INFO, scope: [:support, :question]), TYPE_INFO, FAQ_CONTACTER_SERVICE_EN_CHARGE_URL], - [I18n.t(TYPE_PERDU, scope: [:support, :question]), TYPE_PERDU, LISTE_DES_DEMARCHES_URL], - [I18n.t(TYPE_INSTRUCTION, scope: [:support, :question]), TYPE_INSTRUCTION, FAQ_OU_EN_EST_MON_DOSSIER_URL], - [I18n.t(TYPE_AMELIORATION, scope: [:support, :question]), TYPE_AMELIORATION, FEATURE_UPVOTE_URL], - [I18n.t(TYPE_AUTRE, scope: [:support, :question]), TYPE_AUTRE] + [I18n.t(:question, scope: [:support, :index, TYPE_INFO]), TYPE_INFO, FAQ_CONTACTER_SERVICE_EN_CHARGE_URL], + [I18n.t(:question, scope: [:support, :index, TYPE_PERDU]), TYPE_PERDU, LISTE_DES_DEMARCHES_URL], + [I18n.t(:question, scope: [:support, :index, TYPE_INSTRUCTION]), TYPE_INSTRUCTION, FAQ_OU_EN_EST_MON_DOSSIER_URL], + [I18n.t(:question, scope: [:support, :index, TYPE_AMELIORATION]), TYPE_AMELIORATION, FEATURE_UPVOTE_URL], + [I18n.t(:question, scope: [:support, :index, TYPE_AUTRE]), TYPE_AUTRE] ] end diff --git a/app/views/support/admin.html.haml b/app/views/support/admin.html.haml index 7552e68f6..37f753014 100644 --- a/app/views/support/admin.html.haml +++ b/app/views/support/admin.html.haml @@ -20,7 +20,7 @@ .contact-champ = label_tag :type do - = t('your_question', scope: [:support, :question]) + = t('your_question', scope: [:supportadmin]) %span.mandatory * = select_tag :type, options_for_select(@options, params[:type]) diff --git a/app/views/support/index.html.haml b/app/views/support/index.html.haml index 5f5f23806..3c8c3cc4e 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support/index.html.haml @@ -1,16 +1,16 @@ -- content_for(:title, 'Contact') +- content_for(:title, t('.contact')) - content_for :footer do = render partial: "root/footer" #contact-form .container %h1.new-h1 - = t('contact', scope: [:support]) + = t('.contact') = form_tag contact_path, method: :post, multipart: true, class: 'form' do |f| .description - %p= t('intro_html', scope: [:support]) + %p= t('.intro_html') %br %p.mandatory-explanation= t('asterisk_html', scope: [:utils]) @@ -23,7 +23,7 @@ .contact-champ = label_tag :type do - = t('your_question', scope: [:support, :question]) + = t('.your_question') %span.mandatory * = hidden_field_tag :type, params[:type] %dl @@ -37,9 +37,10 @@ %dd .support.card.featured.hidden{ id: question_type } .card-title - = t('our_answer', scope: [:support, :response]) + = t('.our_answer') .card-content - = t("#{question_type}_html", scope: [:support, :response], base_url: APPLICATION_BASE_URL, "link_#{question_type}": link) + -# i18n-tasks-use t("support.index.#{question_type}.answer_html") + = t('answer_html', scope: [:support, :index, question_type], base_url: APPLICATION_BASE_URL, "link_#{question_type}": link) .contact-champ = label_tag :dossier_id, t('file_number', scope: [:utils]) @@ -61,9 +62,9 @@ = label_tag :piece_jointe do = t('pj', scope: [:utils]) %p.notice.hidden{ data: { 'contact-type-only': Helpscout::FormAdapter::TYPE_AMELIORATION } } - = t('notice_pj_product', scope: [:support, :response]) + = t('.notice_pj_product') %p.notice.hidden{ data: { 'contact-type-only': Helpscout::FormAdapter::TYPE_AUTRE } } - = t('notice_pj_other', scope: [:support, :response]) + = t('.notice_pj_other') = file_field_tag :piece_jointe = hidden_field_tag :tags, @tags&.join(',') diff --git a/config/locales/views/support/en.yml b/config/locales/views/support/en.yml new file mode 100644 index 000000000..e34d8ac30 --- /dev/null +++ b/config/locales/views/support/en.yml @@ -0,0 +1,50 @@ +en: + support: + index: + contact: Contact + intro_html: Contact us via this form and we will answer you as quickly as possible.
Make sure you provide all the required information so we can help you in the best way. + your_question: Your question + our_answer: 👉 Our answer + notice_pj_product: A screenshot can help us identify the element to improve. + notice_pj_other: A screenshot can help us identify the issue. + procedure_info: + question: I've encountered a problem while completing my application + answer_html: "

Are you sure that all the mandatory fields ( * ) are properly filled? +

If you have questions about the information requested, contact the service in charge of the procedure.

+

Find more information

" + instruction_info: + question: I have a question about the instruction of my application + answer_html: "

If you have questions about the instruction of your application (response delay for example), contact directly the instructor via our mail system.

+

Find more information

+
+

If you are facing technical issues on the website, use the form below. We will not be able to inform you about the instruction of your application.

" + product: + question: I have an idea to improve the website + answer_html: "

Got an idea? Please check our enhancement dashboard

+

  • Vote for your priority improvements
  • +
  • Share your own ideas

+

➡ Access the enhancement dashboard

" + lost_user: + question: I am having trouble finding the procedure I am looking for + answer_html: "

We invite you to contact the administration in charge of the procedure so they can provide you the link. + It should look like this: %{base_url}/commencer/NOM_DE_LA_DEMARCHE.

+
+

You can find here the most popular procedures (licence, detr, etc.) :

+

%{link_lost_user}

" + other: + question: Other topic + supportadmin: + your_question: Your question + admin_intro_html: "

As an administration, you can contact us through this form. We'll answer you as quickly as possibly by e-mail or phone.

+
+

Caution, this form is dedicated to public bodies only. + It does not concern individuals, companies nor associations (except those recognised of public utility). If you belong to one of these categories, contact us here.

" + contact_team: Contact our team + pro_phone_number: Professional phone number (direct line) + pro_mail: Professional email address + admin demande rdv: I request an appointment for an online presentation of %{app_name} + admin question: I have a question about %{app_name} + admin soucis: I am facing a technical issue on %{app_name} + admin suggestion produit: I have a suggestion for an evolution + admin demande compte: I want to open an admin account with an Orange, Wanadoo, etc. email + admin autre: Other topic diff --git a/config/locales/views/support/fr.yml b/config/locales/views/support/fr.yml new file mode 100644 index 000000000..1ac911583 --- /dev/null +++ b/config/locales/views/support/fr.yml @@ -0,0 +1,50 @@ +fr: + support: + index: + contact: Contact + intro_html: Contactez-nous via ce formulaire et nous vous répondrons dans les plus brefs délais.
Pensez bien à nous donner le plus d’informations possible pour que nous puissions vous aider au mieux. + your_question: Votre question + our_answer: 👉 Notre réponse + notice_pj_product: Une capture d’écran peut nous aider à identifier plus facilement l’endroit à améliorer. + notice_pj_other: Une capture d’écran peut nous aider à identifier plus facilement le problème. + procedure_info: + question: J’ai un problème lors du remplissage de mon dossier + answer_html: "

Avez-vous bien vérifié que tous les champs obligatoires ( * ) sont remplis ? +

Si vous avez des questions sur les informations à saisir, contactez les services en charge de la démarche.

+

En savoir plus

" + instruction_info: + question: J’ai une question sur l’instruction de mon dossier + answer_html: "

Si vous avez des questions sur l’instruction de votre dossier (par exemple sur les délais), nous vous invitons à contacter directement les services qui instruisent votre dossier par votre messagerie.

+

En savoir plus

+
+

Si vous souhaitez poser une question pour un problème technique sur le site, utilisez le formulaire ci-dessous. Nous ne pourrons pas vous renseigner sur l’instruction de votre dossier.

" + product: + question: J’ai une idée d’amélioration pour votre site + answer_html: "

Une idée ? Pensez à consulter notre tableau de bord des améliorations

+

  • Votez pour vos améliorations prioritaires;
  • +
  • Proposez votre propre idée.

+

➡ Accéder au tableau des améliorations

" + lost_user: + question: Je ne trouve pas la démarche que je veux faire + answer_html: "

Nous vous invitons à contacter l’administration en charge de votre démarche pour qu’elle vous indique le lien à suivre. Celui-ci devrait ressembler à cela : %{base_url}/commencer/NOM_DE_LA_DEMARCHE.

+
+

Vous pouvez aussi consulter ici la liste de nos démarches les plus frequentes (permis, detr etc) :

+

%{link_lost_user}

" + other: + question: Autre sujet + supportadmin: + your_question: Votre question + admin_intro_html: "

En tant qu’administration, vous pouvez nous contactez via ce formulaire. Nous vous répondrons dans les plus brefs délais, par email ou par téléphone.

+
+

Attention, ce formulaire est réservé uniquement aux organismes publics. + Il ne concerne ni les particuliers, ni les entreprises, ni les associations (sauf celles reconnues d’utilité publique). Si c'est votre cas, rendez-vous sur notre + formulaire de contact public.

" + contact_team: Contactez notre équipe + pro_phone_number: Numéro de téléphone professionnel (ligne directe) + pro_mail: Adresse e-mail professionnelle + admin demande rdv: Demande de RDV pour une présentation à distance de %{app_name} + admin question: J’ai une question sur %{app_name} + admin soucis: J’ai un problème technique avec %{app_name} + admin suggestion produit: J’ai une proposition d’évolution + admin demande compte: Je souhaite ouvrir un compte administrateur avec un email Orange, Wanadoo, etc. + admin autre: Autre sujet diff --git a/config/locales/views/support/index.en.yml b/config/locales/views/support/index.en.yml deleted file mode 100644 index 405ea15ce..000000000 --- a/config/locales/views/support/index.en.yml +++ /dev/null @@ -1,46 +0,0 @@ -en: - support: - contact: Contact - intro_html: Contact us via this form and we will answer you as quickly as possible.
Make sure you provide all the required information so we can help you in the best way. - question: - your_question: Your question - choose_question: Choose your question - procedure_info: I've encountered a problem while completing my application - instruction_info: I have a question about the instruction of my application - product: I have an idea to improve the website - lost_user: I am having trouble finding the procedure I am looking for - other: Other topic - response: - our_answer: 👉 Our answer - procedure_info_html: "

Are you sure that all the mandatory fields ( * ) are properly filled? -

If you have questions about the information requested, contact the service in charge of the procedure.

-

Find more information

" - instruction_info_html: "

If you have questions about the instruction of your application (response delay for example), contact directly the instructor via our mail system.

-

Find more information

-
-

If you are facing technical issues on the website, use the form below. We will not be able to inform you about the instruction of your application.

" - product_html: "

Got an idea? Please check our enhancement dashboard

-

  • Vote for your priority improvements
  • -
  • Share your own ideas

-

➡ Access the enhancement dashboard

" - lost_user_html: "

We invite you to contact the administration in charge of the procedure so they can provide you the link. - It should look like this: %{base_url}/commencer/NOM_DE_LA_DEMARCHE.

-
-

You can find here the most popular procedures (licence, detr, etc.) :

-

%{link_lost_user}

" - notice_pj_product: A screenshot can help us identify the element to improve. - notice_pj_other: A screenshot can help us identify the issue. - supportadmin: - admin_intro_html: "

As an administration, you can contact us through this form. We'll answer you as quickly as possibly by e-mail or phone.

-
-

Caution, this form is dedicated to public bodies only. - It does not concern individuals, companies nor associations (except those recognised of public utility). If you belong to one of these categories, contact us here.

" - contact_team: Contact our team - pro_phone_number: Professional phone number (direct line) - pro_mail: Professional email address - admin demande rdv: I request an appointment for an online presentation of %{app_name} - admin question: I have a question about %{app_name} - admin soucis: I am facing a technical issue on %{app_name} - admin suggestion produit: I have a suggestion for an evolution - admin demande compte: I want to open an admin account with an Orange, Wanadoo, etc. email - admin autre: Other topic diff --git a/config/locales/views/support/index.fr.yml b/config/locales/views/support/index.fr.yml deleted file mode 100644 index 9b5b0ae10..000000000 --- a/config/locales/views/support/index.fr.yml +++ /dev/null @@ -1,46 +0,0 @@ -fr: - support: - contact: Contact - intro_html: Contactez-nous via ce formulaire et nous vous répondrons dans les plus brefs délais.
Pensez bien à nous donner le plus d’informations possible pour que nous puissions vous aider au mieux. - question: - your_question: Votre question - choose_question: Choisir une question - procedure_info: J’ai un problème lors du remplissage de mon dossier - instruction_info: J’ai une question sur l’instruction de mon dossier - product: J’ai une idée d’amélioration pour votre site - lost_user: Je ne trouve pas la démarche que je veux faire - other: Autre sujet - response: - our_answer: 👉 Notre réponse - procedure_info_html: "

Avez-vous bien vérifié que tous les champs obligatoires ( * ) sont remplis ? -

Si vous avez des questions sur les informations à saisir, contactez les services en charge de la démarche.

-

En savoir plus

" - instruction_info_html: "

Si vous avez des questions sur l’instruction de votre dossier (par exemple sur les délais), nous vous invitons à contacter directement les services qui instruisent votre dossier par votre messagerie.

-

En savoir plus

-
-

Si vous souhaitez poser une question pour un problème technique sur le site, utilisez le formulaire ci-dessous. Nous ne pourrons pas vous renseigner sur l’instruction de votre dossier.

" - product_html: "

Une idée ? Pensez à consulter notre tableau de bord des améliorations

-

  • Votez pour vos améliorations prioritaires;
  • -
  • Proposez votre propre idée.

-

➡ Accéder au tableau des améliorations

" - lost_user_html: "

Nous vous invitons à contacter l’administration en charge de votre démarche pour qu’elle vous indique le lien à suivre. Celui-ci devrait ressembler à cela : %{base_url}/commencer/NOM_DE_LA_DEMARCHE.

-
-

Vous pouvez aussi consulter ici la liste de nos démarches les plus frequentes (permis, detr etc) :

-

%{link_lost_user}

" - notice_pj_product: Une capture d’écran peut nous aider à identifier plus facilement l’endroit à améliorer. - notice_pj_other: Une capture d’écran peut nous aider à identifier plus facilement le problème. - supportadmin: - admin_intro_html: "

En tant qu’administration, vous pouvez nous contactez via ce formulaire. Nous vous répondrons dans les plus brefs délais, par email ou par téléphone.

-
-

Attention, ce formulaire est réservé uniquement aux organismes publics. - Il ne concerne ni les particuliers, ni les entreprises, ni les associations (sauf celles reconnues d’utilité publique). Si c'est votre cas, rendez-vous sur notre - formulaire de contact public.

" - contact_team: Contactez notre équipe - pro_phone_number: Numéro de téléphone professionnel (ligne directe) - pro_mail: Adresse e-mail professionnelle - admin demande rdv: Demande de RDV pour une présentation à distance de %{app_name} - admin question: J’ai une question sur %{app_name} - admin soucis: J’ai un problème technique avec %{app_name} - admin suggestion produit: J’ai une proposition d’évolution - admin demande compte: Je souhaite ouvrir un compte administrateur avec un email Orange, Wanadoo, etc. - admin autre: Autre sujet From 6656d1130b78867ab652ae6b504675e1ed4f9222 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 22:48:35 -0500 Subject: [PATCH 7/8] i18n: refactor admin support locales This allow i18n-tasks to better detect dynamic keys. --- app/lib/helpscout/form_adapter.rb | 12 ++++----- app/views/support/admin.html.haml | 10 ++++---- config/locales/views/support/en.yml | 36 +++++++++++++++------------ config/locales/views/support/fr.yml | 38 +++++++++++++++++------------ 4 files changed, 54 insertions(+), 42 deletions(-) diff --git a/app/lib/helpscout/form_adapter.rb b/app/lib/helpscout/form_adapter.rb index 937189305..16da5c8fb 100644 --- a/app/lib/helpscout/form_adapter.rb +++ b/app/lib/helpscout/form_adapter.rb @@ -13,12 +13,12 @@ class Helpscout::FormAdapter def self.admin_options [ - [I18n.t(ADMIN_TYPE_QUESTION, scope: [:supportadmin], app_name: APPLICATION_NAME), ADMIN_TYPE_QUESTION], - [I18n.t(ADMIN_TYPE_RDV, scope: [:supportadmin], app_name: APPLICATION_NAME), ADMIN_TYPE_RDV], - [I18n.t(ADMIN_TYPE_SOUCIS, scope: [:supportadmin], app_name: APPLICATION_NAME), ADMIN_TYPE_SOUCIS], - [I18n.t(ADMIN_TYPE_PRODUIT, scope: [:supportadmin]), ADMIN_TYPE_PRODUIT], - [I18n.t(ADMIN_TYPE_DEMANDE_COMPTE, scope: [:supportadmin]), ADMIN_TYPE_DEMANDE_COMPTE], - [I18n.t(ADMIN_TYPE_AUTRE, scope: [:supportadmin]), ADMIN_TYPE_AUTRE] + [I18n.t(:question, scope: [:support, :admin, ADMIN_TYPE_QUESTION], app_name: APPLICATION_NAME), ADMIN_TYPE_QUESTION], + [I18n.t(:question, scope: [:support, :admin, ADMIN_TYPE_RDV], app_name: APPLICATION_NAME), ADMIN_TYPE_RDV], + [I18n.t(:question, scope: [:support, :admin, ADMIN_TYPE_SOUCIS], app_name: APPLICATION_NAME), ADMIN_TYPE_SOUCIS], + [I18n.t(:question, scope: [:support, :admin, ADMIN_TYPE_PRODUIT]), ADMIN_TYPE_PRODUIT], + [I18n.t(:question, scope: [:support, :admin, ADMIN_TYPE_DEMANDE_COMPTE]), ADMIN_TYPE_DEMANDE_COMPTE], + [I18n.t(:question, scope: [:support, :admin, ADMIN_TYPE_AUTRE]), ADMIN_TYPE_AUTRE] ] end diff --git a/app/views/support/admin.html.haml b/app/views/support/admin.html.haml index 37f753014..2b30c4ee6 100644 --- a/app/views/support/admin.html.haml +++ b/app/views/support/admin.html.haml @@ -3,10 +3,10 @@ #contact-form .container %h1.new-h1 - = t('contact_team', scope: [:supportadmin]) + = t('.contact_team') .description - = t('admin_intro_html', scope: [:supportadmin], contact_path: contact_path) + = t('.admin_intro_html', contact_path: contact_path) %br %p.mandatory-explanation= t('asterisk_html', scope: [:utils]) @@ -14,19 +14,19 @@ - if !user_signed_in? .contact-champ = label_tag :email do - = t('pro_mail', scope: [:supportadmin]) + = t('.pro_mail') %span.mandatory * = text_field_tag :email, params[:email], required: true .contact-champ = label_tag :type do - = t('your_question', scope: [:supportadmin]) + = t('.your_question') %span.mandatory * = select_tag :type, options_for_select(@options, params[:type]) .contact-champ = label_tag :phone do - = t('pro_phone_number', scope: [:supportadmin]) + = t('.pro_phone_number') = text_field_tag :phone .contact-champ diff --git a/config/locales/views/support/en.yml b/config/locales/views/support/en.yml index e34d8ac30..2dbe52b45 100644 --- a/config/locales/views/support/en.yml +++ b/config/locales/views/support/en.yml @@ -33,18 +33,24 @@ en:

%{link_lost_user}

" other: question: Other topic - supportadmin: - your_question: Your question - admin_intro_html: "

As an administration, you can contact us through this form. We'll answer you as quickly as possibly by e-mail or phone.

-
-

Caution, this form is dedicated to public bodies only. - It does not concern individuals, companies nor associations (except those recognised of public utility). If you belong to one of these categories, contact us here.

" - contact_team: Contact our team - pro_phone_number: Professional phone number (direct line) - pro_mail: Professional email address - admin demande rdv: I request an appointment for an online presentation of %{app_name} - admin question: I have a question about %{app_name} - admin soucis: I am facing a technical issue on %{app_name} - admin suggestion produit: I have a suggestion for an evolution - admin demande compte: I want to open an admin account with an Orange, Wanadoo, etc. email - admin autre: Other topic + admin: + your_question: Your question + admin_intro_html: "

As an administration, you can contact us through this form. We'll answer you as quickly as possibly by e-mail or phone.

+
+

Caution, this form is dedicated to public bodies only. + It does not concern individuals, companies nor associations (except those recognised of public utility). If you belong to one of these categories, contact us here.

" + contact_team: Contact our team + pro_phone_number: Professional phone number (direct line) + pro_mail: Professional email address + admin question: + question: I have a question about %{app_name} + admin demande rdv: + question: I request an appointment for an online presentation of %{app_name} + admin soucis: + question: I am facing a technical issue on %{app_name} + admin suggestion produit: + question: I have a suggestion for an evolution + admin demande compte: + question: I want to open an admin account with an Orange, Wanadoo, etc. email + admin autre: + question: Other topic diff --git a/config/locales/views/support/fr.yml b/config/locales/views/support/fr.yml index 1ac911583..82b8f349c 100644 --- a/config/locales/views/support/fr.yml +++ b/config/locales/views/support/fr.yml @@ -32,19 +32,25 @@ fr:

%{link_lost_user}

" other: question: Autre sujet - supportadmin: - your_question: Votre question - admin_intro_html: "

En tant qu’administration, vous pouvez nous contactez via ce formulaire. Nous vous répondrons dans les plus brefs délais, par email ou par téléphone.

-
-

Attention, ce formulaire est réservé uniquement aux organismes publics. - Il ne concerne ni les particuliers, ni les entreprises, ni les associations (sauf celles reconnues d’utilité publique). Si c'est votre cas, rendez-vous sur notre - formulaire de contact public.

" - contact_team: Contactez notre équipe - pro_phone_number: Numéro de téléphone professionnel (ligne directe) - pro_mail: Adresse e-mail professionnelle - admin demande rdv: Demande de RDV pour une présentation à distance de %{app_name} - admin question: J’ai une question sur %{app_name} - admin soucis: J’ai un problème technique avec %{app_name} - admin suggestion produit: J’ai une proposition d’évolution - admin demande compte: Je souhaite ouvrir un compte administrateur avec un email Orange, Wanadoo, etc. - admin autre: Autre sujet + admin: + your_question: Votre question + admin_intro_html: "

En tant qu’administration, vous pouvez nous contactez via ce formulaire. Nous vous répondrons dans les plus brefs délais, par email ou par téléphone.

+
+

Attention, ce formulaire est réservé uniquement aux organismes publics. + Il ne concerne ni les particuliers, ni les entreprises, ni les associations (sauf celles reconnues d’utilité publique). Si c'est votre cas, rendez-vous sur notre + formulaire de contact public.

" + contact_team: Contactez notre équipe + pro_phone_number: Numéro de téléphone professionnel (ligne directe) + pro_mail: Adresse e-mail professionnelle + admin question: + question: J’ai une question sur %{app_name} + admin demande rdv: + question: Demande de RDV pour une présentation à distance de %{app_name} + admin soucis: + question: J’ai un problème technique avec %{app_name} + admin suggestion produit: + question: J’ai une proposition d’évolution + admin demande compte: + question: Je souhaite ouvrir un compte administrateur avec un email Orange, Wanadoo, etc. + admin autre: + question: Autre sujet From 6271c41fef0d4f5c0c0631755bc351f6bfa0dd17 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 16 Sep 2021 22:52:49 -0500 Subject: [PATCH 8/8] i18n: add automated check for unused locales (en only) In a next PR we'll also check for french (and thus all locales). --- lib/tasks/lint.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake index 348f8079c..05742b96a 100644 --- a/lib/tasks/lint.rake +++ b/lib/tasks/lint.rake @@ -3,6 +3,7 @@ task :lint do sh "bundle exec haml-lint app/views/" sh "bundle exec scss-lint app/assets/stylesheets/" sh "bundle exec i18n-tasks missing --locales fr" + sh "bundle exec i18n-tasks unused --locale en" # TODO: check for all locales sh "bundle exec i18n-tasks check-consistent-interpolations" sh "bundle exec brakeman --no-pager" sh "yarn lint:js"