diff options
author | José Valim <jose.valim@gmail.com> | 2010-05-23 13:22:19 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-23 13:22:19 +0200 |
commit | 8d5939c0966fa0255eae75e29f68ec55539206d1 (patch) | |
tree | 1708cfdf4768987a140734cddff1df8336317f57 /activesupport | |
parent | f3abc8ac36055afed9fcc902c33ee146e066d17a (diff) | |
download | rails-8d5939c0966fa0255eae75e29f68ec55539206d1.tar.gz rails-8d5939c0966fa0255eae75e29f68ec55539206d1.tar.bz2 rails-8d5939c0966fa0255eae75e29f68ec55539206d1.zip |
Fix a bug where I18n fallbacks modules where not included in the proper backend if it was set through config.i18n.backend.
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/railtie.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/railtie.rb b/activesupport/lib/active_support/railtie.rb index 0243157e35..59f9ab18b1 100644 --- a/activesupport/lib/active_support/railtie.rb +++ b/activesupport/lib/active_support/railtie.rb @@ -48,19 +48,20 @@ module I18n # Set the i18n configuration from config.i18n but special-case for # the load_path which should be appended to what's already set instead of overwritten. config.after_initialize do |app| + fallbacks = app.config.i18n.delete(:fallbacks) + app.config.i18n.each do |setting, value| case setting when :railties_load_path app.config.i18n.load_path.unshift(*value) when :load_path I18n.load_path += value - when :fallbacks - init_fallbacks(value) if value && validate_fallbacks(value) else I18n.send("#{setting}=", value) end end + init_fallbacks(fallbacks) if fallbacks && validate_fallbacks(fallbacks) I18n.reload! end |