aboutsummaryrefslogtreecommitdiffstats
path: root/config/environment.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/environment.rb')
-rw-r--r--config/environment.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/config/environment.rb b/config/environment.rb
index 7c0662d3a..d15ee9a0e 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -37,7 +37,11 @@ require File.join(File.dirname(__FILE__), '../lib/old_rubygems_patch')
Rails::Initializer.run do |config|
# Load intial mySociety config
- MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true)
+ if ENV["RAILS_ENV"] == "test"
+ MySociety::Config.set_file(File.join(config.root_path, 'config', 'test'), true)
+ else
+ MySociety::Config.set_file(File.join(config.root_path, 'config', 'general'), true)
+ end
MySociety::Config.load_default
# Settings in config/environments/* take precedence over those specified here
@@ -119,14 +123,8 @@ if (MySociety::Config.get("DOMAIN", "") != "")
end
# fallback locale and available locales
-if ENV["RAILS_ENV"] == "test"
- # The tests assume that the "en" and "es" locales are available
- available_locales = ["en", "es"]
- default_locale = "en"
-else
- available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en es').split(/ /)
- default_locale = MySociety::Config.get('DEFAULT_LOCALE', 'en')
-end
+available_locales = MySociety::Config.get('AVAILABLE_LOCALES', '').split(/ /)
+default_locale = MySociety::Config.get('DEFAULT_LOCALE', '')
FastGettext.default_available_locales = available_locales
I18n.locale = default_locale