From 37e344bb339c2ce00035efb3fbaa74aa266ad1a6 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Thu, 8 Feb 2018 17:35:57 -0800 Subject: [PATCH] Ensure locales have unique names Previously, we listed both en-IN as "English (UK)" and es-MX as "Castellano (ES)". This commit adds a spec to ensure that the locales have a unique names and updates the two offending locales. --- config/locales/en-IN.yml | 2 +- config/locales/es-MX.yml | 2 +- spec/helpers/locale_helper_spec.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/locales/en-IN.yml b/config/locales/en-IN.yml index b981dafa..0111ef64 100644 --- a/config/locales/en-IN.yml +++ b/config/locales/en-IN.yml @@ -631,7 +631,7 @@ en-IN: available_locales: language: localization_settings: - this_file_language: English (UK) + this_file_language: English (IN) icon: Icon identifier: image: Image diff --git a/config/locales/es-MX.yml b/config/locales/es-MX.yml index 15b53829..982deaf1 100644 --- a/config/locales/es-MX.yml +++ b/config/locales/es-MX.yml @@ -636,7 +636,7 @@ es-MX: available_locales: Traduciones Disponibles language: Idioma localization_settings: Ajustes de traducciones - this_file_language: + this_file_language: Castellano (MX) icon: Icono identifier: image: Imagen diff --git a/spec/helpers/locale_helper_spec.rb b/spec/helpers/locale_helper_spec.rb index a9740318..c1ac5840 100644 --- a/spec/helpers/locale_helper_spec.rb +++ b/spec/helpers/locale_helper_spec.rb @@ -23,5 +23,13 @@ is_expected.to match_array SolidusI18n::Locale.all end end + + describe 'locale presentation' do + subject { all_locales_options.map(&:first) } + + it 'should all be unique' do + is_expected.to match_array(subject.uniq) + end + end end end