// fallback to one language
fallbackLng: ['fr', 'en']
// fallback depending on user language
'de-CH': ['fr', 'it'], //French and Italian are also spoken in Switzerland
'zh-Hant': ['zh-Hans', 'en'],
// function that returns an array of fallbacks
// your function may also return a string or object as above
if (!code || code === 'en') return ['en-US'];
const fallbacks = [code];
// We maintain en-US and en-AU. Some regions will prefer en-AU.
if (code.startsWith('en-') && !['en-US', 'en-AU'].includes(code)) {
if (['en-GB', 'en-NZ', 'en-IR'].includes(code)) fallbacks.push('en-AU');
else fallbacks.push('en-US');
const langPart = code.split('-')[0];
if (langPart !== code) fallbacks.push(langPart);
// finally, developer language