lib/globalize.js
function findFallbackLocale(locale) {
  const locales = getAvailableLocales();

  for (let i = locale.length - 1; i > 1; i -= 1) {
    const key = locale.substring(0, i);

    if (locales.includes(key)) {
      return key;
    }
  }

  return null;
}
function findFallbackLocale(locale) {
  const locales = getAvailableLocales();

  for (let i = locale.length - 1; i > 1; i -= 1) {
    const key = locale.substring(0, i);

    if (locales.includes(key)) {
      return key;
    }
  }

  return null;
}
function findFallbackLocale ( locale ) { const locales = getAvailableLocales ( ) ; for ( let i = locale . length - 1 ; i > 1 ; i -= 1 ) { const key = locale . substring ( 0 , i ) ; if ( locales . includes ( key ) ) { return key ; } } return null ; }
Find a fallback locale
Find a fallback locale