feat(commune): translate messages in component

This commit is contained in:
Paul Chavard 2023-03-28 18:00:27 +02:00
parent 00fc2f519f
commit f1658dedc5
3 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1,4 @@
---
en:
postal_code: Postal code of the municipality
not_found: No municipality found for postal code %{postal_code}

View file

@ -0,0 +1,4 @@
---
fr:
postal_code: Code postal de la commune
not_found: Aucune commune trouvée pour le code postal %{postal_code}

View file

@ -1,8 +1,8 @@
%label.notice{ for: code_postal_input_id } Code postal de la commune
%label.notice{ for: code_postal_input_id }= t('.postal_code')
= @form.text_field :code_postal, required: @champ.required?, id: code_postal_input_id, class: "width-33-desktop width-100-mobile small-margin"
- if @champ.code_postal_with_fallback?
- if commune_options.empty?
.fr-error-text.mb-4= "Aucune commune trouvée pour le code postal #{@champ.code_postal_with_fallback}"
.fr-error-text.mb-4= t('.not_found', postal_code: @champ.code_postal_with_fallback)
- elsif commune_options.size <= 3
%fieldset.radios
- commune_options.each.with_index do |(option, value), index|