5

How to configure i18n to use en locale translation if translation is missing in specific locale?

Currently translation missing message is inserted.

Im using RoR 3.1.

Alexey Zakharov
  • 24,694
  • 42
  • 126
  • 197
  • 1
    dupe of http://stackoverflow.com/q/4223806/252799 and older as copy pasted below (dislike that) http://stackoverflow.com/q/2324398/252799 Dupes make SO worse, not better. – oma Jun 08 '12 at 21:13

1 Answers1

14

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'}
Community
  • 1
  • 1
Alexey Zakharov
  • 24,694
  • 42
  • 126
  • 197