From e46f09dfb9d6619a46a8345a189f65d1138c9f2d Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Thu, 22 Aug 2024 11:05:35 +0200 Subject: [PATCH] feat(cojo): date format hint is localized, depending on browser --- .../editable_champ/cojo_component/cojo_component.en.yml | 1 + .../editable_champ/cojo_component/cojo_component.fr.yml | 1 + .../editable_champ/cojo_component/cojo_component.html.haml | 1 + 3 files changed, 3 insertions(+) diff --git a/app/components/editable_champ/cojo_component/cojo_component.en.yml b/app/components/editable_champ/cojo_component/cojo_component.en.yml index 88069f92788..9b243672944 100644 --- a/app/components/editable_champ/cojo_component/cojo_component.en.yml +++ b/app/components/editable_champ/cojo_component/cojo_component.en.yml @@ -3,5 +3,6 @@ en: accreditation_number_label: Accreditation number accreditation_number_notice: Identification number issued by Paris 2024 accreditation_birthdate_label: Date of birth + accreditation_birthdate_hint: 'Format: MM/JJ/AAAA' accreditation_number_error: Invalid accreditation number accreditation_number_verification_pending: Accreditation number verification in progress diff --git a/app/components/editable_champ/cojo_component/cojo_component.fr.yml b/app/components/editable_champ/cojo_component/cojo_component.fr.yml index 914b945957a..165d4352573 100644 --- a/app/components/editable_champ/cojo_component/cojo_component.fr.yml +++ b/app/components/editable_champ/cojo_component/cojo_component.fr.yml @@ -3,5 +3,6 @@ fr: accreditation_number_label: Numéro d‘accréditation accreditation_number_notice: Numéro d‘identification délivré par Paris 2024 accreditation_birthdate_label: Date de naissance + accreditation_birthdate_hint: 'Format : JJ/MM/AAAA' accreditation_number_error: Le numéro d‘accréditation est incorrect accreditation_number_verification_pending: Vérification du numéro d‘accréditation en cours diff --git a/app/components/editable_champ/cojo_component/cojo_component.html.haml b/app/components/editable_champ/cojo_component/cojo_component.html.haml index 80ac7ccf35a..b8df8158578 100644 --- a/app/components/editable_champ/cojo_component/cojo_component.html.haml +++ b/app/components/editable_champ/cojo_component/cojo_component.html.haml @@ -17,6 +17,7 @@ .fr-input-group{ class: input_group_class } = @form.label :accreditation_birthdate, for: @champ.accreditation_birthdate_input_id, class: 'fr-label' do - safe_join [t('.accreditation_birthdate_label'), @champ.required? ? render(EditableChamp::AsteriskMandatoryComponent.new) : ''], ' ' + %p.fr-hint-text{ data: { controller: 'date-input-hint' } }= t('.accreditation_birthdate_hint') = @form.date_field :accreditation_birthdate, required: @champ.required?, aria: { describedby: dom_id(@champ, :accreditation_birthdate) },