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