Simplify setting the options in language selector
This commit is contained in:
@@ -10,4 +10,10 @@ class Layout::LocaleSwitcherComponent < ApplicationComponent
|
||||
def locales
|
||||
I18n.available_locales
|
||||
end
|
||||
|
||||
def language_options
|
||||
locales.map do |locale|
|
||||
[name_for_locale(locale), current_path_with_query_params(locale: locale), lang: locale]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user