Replaces locales helper which returns an array by another which returns select options
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user