aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-06-17 15:33:26 -0700
committerLouise Crow <louise.crow@gmail.com>2013-06-17 15:33:26 -0700
commit6a6431abd38ae8b4b62caf457d0e991651826def (patch)
tree5655e2b4170dd772c68eec30f03f4657b7c3a689 /app/controllers/application_controller.rb
parentb78b3610988735652e6eb17004dfa116b0fe2f15 (diff)
parent4a4169c606e0e26b905e11e1fc75c45268498112 (diff)
Merge branch 'hotfix/0.11.0.13' into rails-3-develop
Conflicts: spec/mailers/outgoing_mailer_spec.rb
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index c9ad48693..535f893f0 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -51,6 +51,9 @@ class ApplicationController < ActionController::Base
anonymous_cache(24.hours)
end
+ # This is an override of the method provided by gettext_i18n_rails - note the explicit
+ # setting of I18n.locale, required due to the I18nProxy used in Rails 3 to trigger the
+ # lookup_context and expire the template cache
def set_gettext_locale
if AlaveteliConfiguration::include_default_locale_in_urls == false
params_locale = params[:locale] ? params[:locale] : I18n.default_locale
@@ -63,7 +66,7 @@ class ApplicationController < ActionController::Base
requested_locale = params_locale || session[:locale] || cookies[:locale] || I18n.default_locale
end
requested_locale = FastGettext.best_locale_in(requested_locale)
- session[:locale] = FastGettext.set_locale(requested_locale)
+ session[:locale] = I18n.locale = FastGettext.set_locale(requested_locale)
if !@user.nil?
if @user.locale != requested_locale
@user.locale = session[:locale]