feat: use en as i18n fallback (#41246)
* feat: use en as i18n fallback Loads the English versions of the files as a "fallback" language to avoid displaying keys when a translation is missing. * fix: use en as fallback keypull/41253/head
parent
c6d8996f39
commit
454b267138
|
@ -7,7 +7,7 @@ const { i18nextCodes } = require('../../config/i18n/all-langs');
|
|||
const i18nextCode = i18nextCodes[clientLocale];
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
fallbackLng: i18nextCode,
|
||||
fallbackLng: 'en',
|
||||
lng: i18nextCode,
|
||||
// we only load one language since each language will have it's own server
|
||||
resources: {
|
||||
|
@ -16,6 +16,12 @@ i18n.use(initReactI18next).init({
|
|||
trending: require(`./locales/${clientLocale}/trending.json`),
|
||||
intro: require(`./locales/${clientLocale}/intro.json`),
|
||||
metaTags: require(`./locales/${clientLocale}/meta-tags.json`)
|
||||
},
|
||||
en: {
|
||||
translations: require('./locales/english/translations.json'),
|
||||
trending: require('./locales/english/trending.json'),
|
||||
intro: require('./locales/english/intro.json'),
|
||||
metaTags: require('./locales/english/meta-tags.json')
|
||||
}
|
||||
},
|
||||
ns: ['translations', 'trending', 'intro', 'metaTags'],
|
||||
|
|
Loading…
Reference in New Issue