diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 112e86a4f..8abd400d8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -21,7 +21,8 @@ class ApplicationController < ActionController::Base protected def set_locale - I18n.locale = check_locale( get_user_locale || request.env['HTTP_ACCEPT_LANGUAGE'][0,2].downcase ) + I18n.locale = check_locale( get_user_locale || + request.env['HTTP_ACCEPT_LANGUAGE'] ? request.env['HTTP_ACCEPT_LANGUAGE'][0,2].downcase : nil ) end def get_user_locale