Better to set the default locale in an initializer than in a before_filter

This commit is contained in:
livefromthemoon@gmail.com 2010-10-31 21:55:49 +01:00
parent bfb132280a
commit cf82a0a9c8
2 changed files with 1 additions and 2 deletions

View file

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

View file

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