[refs #443] fixed error whis empty accept languages

This commit is contained in:
Alexander Machehin 2012-05-16 23:20:42 +06:00
parent 2651f0dc52
commit 8facb45bb7
1 changed files with 2 additions and 1 deletions

View File

@ -21,7 +21,8 @@ class ApplicationController < ActionController::Base
protected protected
def set_locale 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 end
def get_user_locale def get_user_locale