diff --git a/app/helpers/i18n_helper.rb b/app/helpers/i18n_helper.rb index 3fca93a061..8d7d5fe0a5 100644 --- a/app/helpers/i18n_helper.rb +++ b/app/helpers/i18n_helper.rb @@ -2,7 +2,7 @@ module I18nHelper def locale_options - OpenFoodNetwork::I18nConfig.available_locales.map do |locale| + OpenFoodNetwork::I18nConfig.selectable_locales.map do |locale| [t('language_name', locale:), locale] end end diff --git a/app/views/spree/admin/users/_form.html.haml b/app/views/spree/admin/users/_form.html.haml index 6eb47fe834..3eeda73283 100644 --- a/app/views/spree/admin/users/_form.html.haml +++ b/app/views/spree/admin/users/_form.html.haml @@ -14,7 +14,7 @@ = hidden_field_tag "user[spree_role_ids][]", "" = f.field_container :locale do = f.label :locale, t(".locale") - = f.select :locale, OpenFoodNetwork::I18nConfig.locale_options, class: "fullwidth" + = f.select :locale, locale_options, class: "fullwidth" = f.field_container :enterprise_limit do = f.label :enterprise_limit, t(".enterprise_limit") = f.text_field :enterprise_limit, class: "fullwidth" diff --git a/spec/system/admin/users_spec.rb b/spec/system/admin/users_spec.rb index dafb50fcc5..6548dbc558 100644 --- a/spec/system/admin/users_spec.rb +++ b/spec/system/admin/users_spec.rb @@ -141,8 +141,8 @@ RSpec.describe "Managing users" do fill_in "Password", with: "user1Secret" fill_in "Confirm Password", with: "user1Secret" - expect(page).to have_select "Language", selected: "en_AU" - select "es", from: "Language" + expect(page).to have_select "Language", selected: "English" + select "EspaƱol", from: "Language" perform_enqueued_jobs do expect do