From 480ecd39c46f18f77ca08c3f0b546d0cf8d6ca44 Mon Sep 17 00:00:00 2001 From: kikito Date: Wed, 19 Aug 2015 21:25:56 +0200 Subject: [PATCH] Replaces locales helper which returns an array by another which returns select options --- app/helpers/application_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cee6db199..11e4cae8c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -14,7 +14,13 @@ module ApplicationHelper home_page? ? '' : 'results' end - def available_locales_to_switch - I18n.available_locales - [I18n.locale] + def available_locale_options_for_select + options_for_select(available_locales_array, I18n.locale) end + + private + def available_locales_array + I18n.available_locales.map { |loc| [I18n.t('locale', locale: loc), loc] } + end + end