bundles/org.eclipse.orion.client.ui/web/gcli/util/l10n.js
function getPluralRule() {
  if (!pluralRule) {
    var lang = navigator.language || navigator.userLanguage;
    // Convert lang to a rule index
    pluralRules.some(function(rule) {
      if (rule.locales.indexOf(lang) !== -1) {
        pluralRule = rule;
        return true;
      }
      return false;
    });

    // Use rule 0 by default, which is no plural forms at all
    if (!pluralRule) {
      console.error('Failed to find plural rule for ' + lang);
      pluralRule = pluralRules[0];
    }
  }

  return pluralRule;
}
function getPluralRule() {
  if (!pluralRule) {
    var lang = navigator.language || navigator.userLanguage;
    // Convert lang to a rule index
    pluralRules.some(function(rule) {
      if (rule.locales.indexOf(lang) !== -1) {
        pluralRule = rule;
        return true;
      }
      return false;
    });

    // Use rule 0 by default, which is no plural forms at all
    if (!pluralRule) {
      console.error('Failed to find plural rule for ' + lang);
      pluralRule = pluralRules[0];
    }
  }

  return pluralRule;
}
function getPluralRule ( ) { if ( ! pluralRule ) { var lang = navigator . language || navigator . userLanguage ; // Convert lang to a rule index pluralRules . some ( function ( rule ) { if ( rule . locales . indexOf ( lang ) !== - 1 ) { pluralRule = rule ; return true ; } return false ; } ) ; // Use rule 0 by default, which is no plural forms at all if ( ! pluralRule ) { console . error ( 'Failed to find plural rule for ' + lang ) ; pluralRule = pluralRules [ 0 ] ; } } return pluralRule ; }
Find the correct plural rule for the current locale
@return a plural rule with a 'get()' function
Find the correct plural rule for the current locale