Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 744
Alexey Zakharov Avatar asked Jan 16 '12 06:01

Alexey Zakharov


People also ask

What is locale i18n?

Angular Internationalizationlink Internationalization, sometimes referenced as i18n, is the process of designing and preparing your project for use in different locales around the world. Localization is the process of building versions of your project for different locales.

What is i18n translation?

Internationalization (sometimes shortened to "I18N , meaning "I - eighteen letters -N") is the process of planning and implementing products and services so that they can easily be adapted to specific local languages and cultures, a process called localization .

How i18n works in React?

Internationalization or i18n is the design and development of a product, application, or document content that enables easy localization for target audiences that vary in culture, region, or language. Thus, React i18n is concerned with localizing React applications for different locales.


1 Answers

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'}
like image 86
Alexey Zakharov Avatar answered Sep 28 '22 16:09

Alexey Zakharov