mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-26 16:58:26 -04:00
try setting locale from query parameter first
This commit is contained in:
1 parent
aebd9e1d4e
commit
6a7c935d43
1 file changed
+2
-2
@@ -35,10 +35,10 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def set_locale
|
||||
I18n.locale = extract_locale_tld || I18n.default_locale
|
||||
I18n.locale = params[:locale] || extract_locale_from_subdomain || I18n.default_locale
|
||||
end
|
||||
|
||||
def extract_locale_tld
|
||||
def extract_locale_from_subdomain
|
||||
parsed_locale = request.subdomains.first
|
||||
I18n.available_locales.map(&:to_s).include?(parsed_locale) ? parsed_locale : nil
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user