|
@ -32,9 +32,15 @@ module BikeBike |
|
|
|
|
|
|
|
|
if Rails.env == 'development' || Rails.env == 'test' |
|
|
if Rails.env == 'development' || Rails.env == 'test' |
|
|
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM |
|
|
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_URL_PARAM |
|
|
|
|
|
I18n.config.language_threshold = 1 |
|
|
else |
|
|
else |
|
|
# detect the language using the subdimain |
|
|
# detect the language using the subdimain |
|
|
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN |
|
|
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 |
|
|
end |
|
|
# if we are in our preview environment, set the locale regex to detect the preview- prefix |
|
|
# 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' |
|
|
I18n.config.host_locale_regex = /^preview\-([a-z]{2})\.bikebike\.org$/ if Rails.env == 'preview' |
|
|