From ba75a6e328d218698b8064d0e07de078ad77bf72 Mon Sep 17 00:00:00 2001 From: benni Date: Sat, 29 Dec 2012 17:47:35 +0100 Subject: [PATCH] Fixed accidently switching to english locale in production. --- app/controllers/application_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 60d85d6e..d22e2e07 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base protect_from_forgery - before_filter :select_foodcoop, :authenticate, :store_controller, :items_per_page, :set_redirect_to + before_filter :select_language, :select_foodcoop, :authenticate, :store_controller, :items_per_page, :set_redirect_to after_filter :remove_controller # Returns the controller handling the current request. @@ -141,4 +141,9 @@ class ApplicationController < ActionController::Base def default_url_options(options = {}) {foodcoop: FoodsoftConfig.scope} end + + # Used to prevent accidently switching to :en in production mode. + def select_language + I18n.locale = :de + end end