Better to set the default locale in an initializer than in a before_filter
This commit is contained in:
parent
bfb132280a
commit
cf82a0a9c8
2 changed files with 1 additions and 2 deletions
|
|
@ -35,7 +35,6 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def set_locale
|
||||
I18n.default_locale = DEFAULT_LANGUAGE
|
||||
if current_user
|
||||
I18n.locale = current_user.language
|
||||
else
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||
I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
|
||||
I18n.default_locale = :en
|
||||
I18n.default_locale = DEFAULT_LANGUAGE
|
||||
|
|
|
|||
Loading…
Reference in a new issue