How to enable fallback in I18n with globalize2

globalize2, internationalization, ruby-on-rails

Solution

Install sven fuchs's i18n library from http://github.com/svenfuchs/i18n

Then, in your environment.rb :

require "i18n/backend/fallbacks" 
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)

using :"en-US" as a default locale:

I18n.default_locale = :"en-US" 
I18n.fallbacks[:ca] # => [:ca, :"en-US", :en]
I18n.fallbacks :dk => [:"se-FI", :"fi-FI"] # => [:dk, :"se-FI", :se, :"fi-FI", :fi, :"en-US", :en]

Problem

So that's the problem. In my application globalize2 returns a NIL string if there's no translation on some record, instead of falling back to default_locale. I wonder how to enable thin functionality? Does anyone figured that out?

Original source