Fixed language detection for our preview environment

This commit is contained in:
Godwin
2015-05-03 15:08:54 -07:00
parent 5f2a609dde
commit b1ecb5ace5
3 changed files with 16 additions and 5 deletions
+5
View File
@@ -28,5 +28,10 @@ module BikeBike
config.i18n.enforce_available_locales = false
self.paths['config/database'] = Rails.root.join('config', 'database.yml')
config.active_record.raise_in_transactional_callbacks = true
# detect the language using the subdimain
I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN
# 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'
end
end