How to configure i18n to use en locale if the translation is not in a specific locale?

How to configure i18n to use the en locale translation if the translation is not in a specific locale?

The letter you entered is missing.

Im using RoR 3.1.

+5
source share
1 answer

Found similar question

Here is the answer:

# application.rb

# rails will fallback to config.i18n.default_locale translation
config.i18n.fallbacks = true

# rails will fallback to en, no matter what is set as config.i18n.default_locale
config.i18n.fallbacks = [:en]

# fallbacks value can also be a hash - a map of fallbacks if you will
# missing translations of es and fr languages will fallback to english
# missing translations in german will fallback to french ('de' => 'fr')
config.i18n.fallbacks = {'es' => 'en', 'fr' => 'en', 'de' => 'fr'}
+13
source

All Articles