From 650eb86a74e2f409e3bb5f570d6f1baa0656422e Mon Sep 17 00:00:00 2001 From: Kane York Date: Wed, 15 Jul 2015 09:49:22 -0700 Subject: [PATCH] Disable in development (server) --- config/initializers/i18n.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/initializers/i18n.rb b/config/initializers/i18n.rb index 685e6e29c43..00dab6775c8 100644 --- a/config/initializers/i18n.rb +++ b/config/initializers/i18n.rb @@ -21,4 +21,15 @@ class FallbackLocaleList < Hash self[I18n.locale].each { |l| I18n.ensure_loaded! l } end end -I18n.fallbacks = FallbackLocaleList.new + +class NoFallbackLocaleList < FallbackLocaleList + def [](locale) + [locale] + end +end + +if Rails.env.production? + I18n.fallbacks = FallbackLocaleList.new +else + I18n.fallbacks = NoFallbackLocaleList.new +end