Skip to content
Extraits de code Groupes Projets
Valider 6e112117 rédigé par livefromthemoon@gmail.com's avatar livefromthemoon@gmail.com
Parcourir les fichiers

guess locale from browser settings

parent 06654b13
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -27,6 +27,7 @@ gem 'roxml', :git => 'git://github.com/Empact/roxml.git' ...@@ -27,6 +27,7 @@ gem 'roxml', :git => 'git://github.com/Empact/roxml.git'
gem 'addressable', :require => 'addressable/uri' gem 'addressable', :require => 'addressable/uri'
gem 'json' gem 'json'
gem 'mini_fb' gem 'mini_fb'
gem 'http_accept_language', :git => 'http://github.com/iain/http_accept_language.git'
#Standards #Standards
gem 'pubsubhubbub' gem 'pubsubhubbub'
......
...@@ -67,6 +67,12 @@ GIT ...@@ -67,6 +67,12 @@ GIT
capistrano (>= 2.5.5) capistrano (>= 2.5.5)
highline (>= 1.4.0) highline (>= 1.4.0)
GIT
remote: http://github.com/iain/http_accept_language.git
revision: 0b78aa7849fc90cf9e12586af162fa4c408a795d
specs:
http_accept_language (1.0.1)
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
...@@ -367,6 +373,7 @@ DEPENDENCIES ...@@ -367,6 +373,7 @@ DEPENDENCIES
em-websocket em-websocket
factory_girl_rails factory_girl_rails
haml haml
http_accept_language!
json json
launchy launchy
magent! magent!
......
...@@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base ...@@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base
before_filter :set_friends_and_status, :except => [:create, :update] before_filter :set_friends_and_status, :except => [:create, :update]
before_filter :count_requests before_filter :count_requests
before_filter :set_invites before_filter :set_invites
before_filter :set_locale
def set_friends_and_status def set_friends_and_status
if current_user if current_user
...@@ -33,4 +34,8 @@ class ApplicationController < ActionController::Base ...@@ -33,4 +34,8 @@ class ApplicationController < ActionController::Base
@invites = current_user.invites @invites = current_user.invites
end end
end end
def set_locale
I18n.locale = request.compatible_language_from I18n.available_locales
end
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter