From 9a3a4d6aefa7e2ca94340754eb5541bea1783de0 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Fri, 16 Apr 2010 22:16:21 +0200 Subject: Make i18n fallbacks configurable and fallback to the default locale by default in production [#4428 state:resolved] Allows to configure locale fallbacks through config.i18n.fallbacks. The default setting config.i18n.fallbacks = true in production.rb will make I18n.t lookup fallback to the I18n.default_locale if a translation could not be found for the current or given locale. config.fallbacks = true config.fallbacks.map = { :ca => :es } config.fallbacks.defaults = [:'es-ES', :es] config.fallbacks = [:'es-ES', :es] config.fallbacks = { :ca => :es } config.fallbacks = [:'es-ES', :es, { :ca => :es }] Signed-off-by: Pratik Naik --- .../rails/app/templates/config/environments/production.rb.tt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt index f902120453..b9fb13b640 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt @@ -39,4 +39,8 @@ # Enable threaded mode # config.threadsafe! + + # Enable locale fallbacks for I18n (makes lookups for any locale fall back to + # the I18n.default_locale when a translation can not be found) + config.i18n.fallbacks = true end -- cgit v1.2.3