aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-07-13 08:49:59 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-07-13 08:49:59 +0100
commit552e6a0f759b84b1e32e391d5c6de5439f4c9ae6 (patch)
tree62aeb51211e64482db9849b39699b319415daca3
parente1010f07cd1af6a8480c1610ff6dd04fe9bb2923 (diff)
Explicitly set default locale when testing as well as in production
-rw-r--r--config/environment.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/config/environment.rb b/config/environment.rb
index acf2a1964..86c66ad18 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -119,15 +119,17 @@ end
# fallback locale and available locales
if ENV["RAILS_ENV"] == "test"
# The tests assume that the "en" and "es" locales are available
- FastGettext.default_available_locales = ["en", "es"]
- I18n.default_locale = :en
+ available_locales = ["en", "es"]
+ default_locale = "en"
else
available_locales = MySociety::Config.get('AVAILABLE_LOCALES', 'en es').split(/ /)
- FastGettext.default_available_locales = available_locales
- I18n.available_locales = available_locales
- I18n.default_locale = MySociety::Config.get('DEFAULT_LOCALE', 'en')
+ default_locale = MySociety::Config.get('DEFAULT_LOCALE', 'en')
end
+FastGettext.default_available_locales = available_locales
+I18n.available_locales = available_locales
+I18n.default_locale = default_locale
+
# Load monkey patches and other things from lib/
require 'tmail_extensions.rb'
require 'activesupport_cache_extensions.rb'