From c358c340432cd699962bdfd30297a74985223261 Mon Sep 17 00:00:00 2001 From: Yuki Date: Wed, 10 Jun 2015 01:06:47 +0530 Subject: [PATCH] HAHA EVERYONE GOT FRENCH BECAUSE I USED A DEPENDENCY, SERVES ME RIGHT --- Gemfile | 1 - Gemfile.lock | 2 -- app/controllers/application_controller.rb | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index e265cbbc..1cf52cf6 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,6 @@ gem 'bootswatch-rails' gem 'sweetalert-rails' gem 'will_paginate' gem 'will_paginate-bootstrap' -gem 'http_accept_language' gem 'devise' gem 'devise-i18n' gem 'devise-async' diff --git a/Gemfile.lock b/Gemfile.lock index 041fa292..5f8b833d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -219,7 +219,6 @@ GEM hitimes (1.2.2) http (0.6.4) http_parser.rb (~> 0.6.0) - http_accept_language (2.0.5) http_parser.rb (0.6.0) i18n (0.7.0) i18n-js (3.0.0.rc10) @@ -498,7 +497,6 @@ DEPENDENCIES font-kit-rails foreman haml - http_accept_language i18n-js jbuilder (~> 2.2.4) jquery-rails diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ffaae5e1..a1faf2fe 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -16,8 +16,8 @@ class ApplicationController < ActionController::Base I18n.locale = current_user.locale elsif not cookies[:hl].nil? I18n.locale = cookies[:hl] - elsif not http_accept_language.user_preferred_languages.length > 0 - I18n.locale = http_accept_language.compatible_language_from(I18n.available_locales) or "en" + else + I18n.locale = 'en' end else I18n.locale = params[:hl]