From 63b4287ef3d1ca922e259525a9246c63e9d1dedd Mon Sep 17 00:00:00 2001 From: Godwin Date: Sat, 29 Aug 2015 16:28:01 -0700 Subject: [PATCH] Actually set treshold values --- config/application.rb | 6 ++++++ config/environments/development.rb | 2 -- config/environments/preview.rb | 2 -- config/environments/production.rb | 2 -- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/application.rb b/config/application.rb index 90fc5d3..d1d9154 100644 --- a/config/application.rb +++ b/config/application.rb @@ -32,9 +32,15 @@ module BikeBike if Rails.env == 'development' || Rails.env == 'test' I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM + I18n.config.language_threshold = 1 else # detect the language using the subdimain I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN + if Rails.env == 'preview' + I18n.config.language_threshold = 1 + else + I18n.config.language_threshold = 90 + end end # if we are in our preview environment, set the locale regex to detect the preview- prefix I18n.config.host_locale_regex = /^preview\-([a-z]{2})\.bikebike\.org$/ if Rails.env == 'preview' diff --git a/config/environments/development.rb b/config/environments/development.rb index a620a2d..42bcc2c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -56,6 +56,4 @@ BikeBike::Application.configure do #config.assets.precompile = false Paypal.sandbox! #Paypal.sandbox = false - - config.i18n.language_threshold = 1 end diff --git a/config/environments/preview.rb b/config/environments/preview.rb index 04dfd7c..c5d7959 100644 --- a/config/environments/preview.rb +++ b/config/environments/preview.rb @@ -99,6 +99,4 @@ BikeBike::Application.configure do } config.action_mailer.raise_delivery_errors = true config.action_mailer.perform_deliveries = true - - config.i18n.language_threshold = 1 end diff --git a/config/environments/production.rb b/config/environments/production.rb index b513180..cf3a012 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -100,6 +100,4 @@ BikeBike::Application.configure do } config.action_mailer.raise_delivery_errors = true config.action_mailer.perform_deliveries = true - - config.i18n.language_threshold = 90 end