Project

General

Profile

Defect #4311 » 0001-Redmine-default-locale-used-before-browser-locale.patch

Candidate patch - Thomas Lecavelier, 2009-11-30 13:14

View differences:

app/controllers/application_controller.rb
95 95
    if User.current.logged?
96 96
      lang = find_language(User.current.language)
97 97
    end
98
    lang ||= Setting.default_language
98 99
    if lang.nil? && request.env['HTTP_ACCEPT_LANGUAGE']
99 100
      accept_lang = parse_qvalues(request.env['HTTP_ACCEPT_LANGUAGE']).first.downcase
100 101
      if !accept_lang.blank?
101 102
        lang = find_language(accept_lang) || find_language(accept_lang.split('-').first)
102 103
      end
103 104
    end
104
    lang ||= Setting.default_language
105 105
    set_language_if_valid(lang)
106 106
  end
107 107
  
(1-1/2)