src/third_party/v8-3.25/src/i18n.js
/**
 * Returns the subset of the provided BCP 47 language priority list for which
 * this service has a matching locale when using the BCP 47 Lookup algorithm.
 * Locales appear in the same order in the returned list as in the input list.
 */
Returns the subset of the provided BCP 47 language priority list for which
this service has a matching locale when using the BCP 47 Lookup algorithm.
Locales appear in the same order in the returned list as in the input list.
Returns the subset of the provided BCP 47 language priority list for which this service has a matching locale when using the BCP 47 Lookup algorithm . Locales appear in the same order in the returned list as in the input list .
function lookupSupportedLocalesOf(requestedLocales, availableLocales) {
  var matchedLocales = [];
  for (var i = 0; i < requestedLocales.length; ++i) {
    var locale = requestedLocales[i].replace(GetUnicodeExtensionRE(), '');
    do {
      if (availableLocales[locale] !== undefined) {
        matchedLocales.push(requestedLocales[i]);
        break;
      }
      var pos = locale.lastIndexOf('-');
      if (pos === -1) {
        break;
      }
      locale = locale.substring(0, pos);
    } while (true);
  }
  return matchedLocales;
}
function lookupSupportedLocalesOf ( requestedLocales , availableLocales ) { var matchedLocales = [ ] ; for ( var i = 0 ; i < requestedLocales . length ; ++ i ) { var locale = requestedLocales [ i ] . replace ( GetUnicodeExtensionRE ( ) , '' ) ; do { if ( availableLocales [ locale ] !== undefined ) { matchedLocales . push ( requestedLocales [ i ] ) ; break ; } var pos = locale . lastIndexOf ( '-' ) ; if ( pos === - 1 ) { break ; } locale = locale . substring ( 0 , pos ) ; } while ( true ) ; } return matchedLocales ; }
Returns the subset of the provided BCP 47 language priority list for which
 this service has a matching locale when using the BCP 47 Lookup algorithm.
Returns the subset of the provided BCP 47 language priority list for which this service has a matching locale when using the BCP 47 Lookup algorithm .
// Remove -u- extension. // Push requested locale not the resolved one. // Truncate locale if possible, if not break.