From ef214d76816b06a4211077b78f70a14e4ada46dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonne=20Ha=C3=9F?= <me@mrzyx.de>
Date: Mon, 25 Aug 2014 21:52:54 +0200
Subject: [PATCH] bump http_accept_language

---
 Gemfile                                   | 2 +-
 Gemfile.lock                              | 4 ++--
 app/controllers/application_controller.rb | 3 +--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/Gemfile b/Gemfile
index 92cd9a7095..0b19184cf3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -81,7 +81,7 @@ gem 'jquery-rails',      '3.0.4'
 
 # Localization
 
-gem 'http_accept_language', '1.0.2'
+gem 'http_accept_language', '2.0.2'
 gem 'i18n-inflector-rails', '1.0.7'
 gem 'rails-i18n',           '4.0.2'
 
diff --git a/Gemfile.lock b/Gemfile.lock
index d951420859..f0f96ccfda 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -214,7 +214,7 @@ GEM
       tilt
     hashie (2.1.2)
     hike (1.2.3)
-    http_accept_language (1.0.2)
+    http_accept_language (2.0.2)
     i18n (0.6.11)
     i18n-inflector (2.6.7)
       i18n (>= 0.4.1)
@@ -522,7 +522,7 @@ DEPENDENCIES
   guard-spork (= 1.5.1)
   haml (= 4.0.5)
   handlebars_assets (= 0.12.0)
-  http_accept_language (= 1.0.2)
+  http_accept_language (= 2.0.2)
   i18n-inflector-rails (= 1.0.7)
   jasmine (= 2.0.2)
   jasmine-jquery-rails (= 2.0.3)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 73a3a35cfb..f95636f60d 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -80,8 +80,7 @@ class ApplicationController < ActionController::Base
     if user_signed_in?
       I18n.locale = current_user.language
     else
-      locale = request.preferred_language_from AVAILABLE_LANGUAGE_CODES
-      locale ||= request.compatible_language_from AVAILABLE_LANGUAGE_CODES
+      locale = http_accept_language.language_region_compatible_from AVAILABLE_LANGUAGE_CODES
       locale ||= DEFAULT_LANGUAGE
       I18n.locale = locale
     end
-- 
GitLab