Replaces locales helper which returns an array by another which returns select options

This commit is contained in:
kikito
2015-08-19 21:25:56 +02:00
parent 332df09491
commit 480ecd39c4

View File

@@ -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