Commit 12575bd7 authored by Jonne Haß's avatar Jonne Haß
Browse files

update http_accept_language and try to find the preferred locale first, should fix #2715

parent 6befd552
......@@ -91,7 +91,7 @@ gem 'acts-as-taggable-on', :git => 'git://github.com/diaspora/acts-as-taggable-o
# URIs and HTTP
gem 'addressable', '2.2.4', :require => 'addressable/uri'
gem 'http_accept_language', :git => 'git://github.com/iain/http_accept_language.git', :ref => '0b78aa7849fc90cf9e12'
gem 'http_accept_language', '~> 1.0.2'
gem 'typhoeus'
# views
......
......@@ -31,13 +31,6 @@ GIT
oauth2 (= 0.5.0)
sinatra
GIT
remote: git://github.com/iain/http_accept_language.git
revision: 0b78aa7849fc90cf9e12586af162fa4c408a795d
ref: 0b78aa7849fc90cf9e12
specs:
http_accept_language (1.0.1)
GEM
remote: http://rubygems.org/
specs:
......@@ -194,6 +187,7 @@ GEM
heroku (>= 2)
rails (>= 2)
highline (1.6.9)
http_accept_language (1.0.2)
i18n (0.5.0)
i18n-inflector (2.6.3)
i18n (>= 0.4.1)
......@@ -443,7 +437,7 @@ DEPENDENCIES
haml
heroku
heroku_san
http_accept_language!
http_accept_language (~> 1.0.2)
i18n-inflector-rails (~> 1.0)
jammit (= 0.6.5)
jasmine (~> 1.1.2)
......
......@@ -76,7 +76,9 @@ class ApplicationController < ActionController::Base
if user_signed_in?
I18n.locale = current_user.language
else
I18n.locale = request.compatible_language_from AVAILABLE_LANGUAGE_CODES
locale = request.preferred_language_from AVAILABLE_LANGUAGE_CODES
locale ||= request.compatible_language_from AVAILABLE_LANGUAGE_CODES
I18n.locale = locale
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment