From 95d1cd6992a09238ac24f7479893ba0122e61241 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 9 Sep 2021 13:15:52 -0500 Subject: [PATCH] i18n: cleanup gender locales The dot in the localized key messes up with i18n-tasks, and causes false positives for missing strings. --- .../shared/dossiers/editable_champs/_civilite.html.haml | 4 ++-- app/views/users/dossiers/identite.html.haml | 4 ++-- config/locales/models/individual/en.yml | 6 +++--- config/locales/models/individual/fr.yml | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/shared/dossiers/editable_champs/_civilite.html.haml b/app/views/shared/dossiers/editable_champs/_civilite.html.haml index 2aaf16e20..18b692a49 100644 --- a/app/views/shared/dossiers/editable_champs/_civilite.html.haml +++ b/app/views/shared/dossiers/editable_champs/_civilite.html.haml @@ -3,8 +3,8 @@ Sélectionnez une des valeurs %label = form.radio_button :value, Individual::GENDER_FEMALE - = t(Individual::GENDER_FEMALE, scope: 'activerecord.attributes.individual.gender_options') + = Individual.human_attribute_name('gender.female') %label = form.radio_button :value, Individual::GENDER_MALE - = t('activerecord.attributes.individual.gender_options')[Individual::GENDER_MALE.to_sym] # GENDER_MALE contains a point letter + = Individual.human_attribute_name('gender.male') diff --git a/app/views/users/dossiers/identite.html.haml b/app/views/users/dossiers/identite.html.haml index 171253561..b78da138f 100644 --- a/app/views/users/dossiers/identite.html.haml +++ b/app/views/users/dossiers/identite.html.haml @@ -14,10 +14,10 @@ .radios %label = f.radio_button :gender, Individual::GENDER_FEMALE, required: true - = t(Individual::GENDER_FEMALE, scope: 'activerecord.attributes.individual.gender_options') + = Individual.human_attribute_name('gender.female') %label = f.radio_button :gender, Individual::GENDER_MALE, required: true - = t('activerecord.attributes.individual.gender_options')[Individual::GENDER_MALE.to_sym] # GENDER_MALE contains a point letter + = Individual.human_attribute_name('gender.male') .flex .inline-champ diff --git a/config/locales/models/individual/en.yml b/config/locales/models/individual/en.yml index 9113e12db..4b60bc0e9 100644 --- a/config/locales/models/individual/en.yml +++ b/config/locales/models/individual/en.yml @@ -6,6 +6,6 @@ en: nom: Last name prenom: First name birthdate: Date de naissance - gender_options: - "Mme": "Ms" - "M.": "Mr" + individual/gender: + female: Ms + male: Mr diff --git a/config/locales/models/individual/fr.yml b/config/locales/models/individual/fr.yml index 5d9d52fcc..7d73e33bf 100644 --- a/config/locales/models/individual/fr.yml +++ b/config/locales/models/individual/fr.yml @@ -6,6 +6,6 @@ fr: nom: Nom prenom: Prénom birthdate: Date de naissance - gender_options: - "Mme": "Madame" - "M.": "Monsieur" \ No newline at end of file + individual/gender: + female: Madame + male: Monsieur