B2G/gecko/browser/components/downloads/src/DownloadsCommon.jsm
/**
   * Returns an object whose keys are the string names from the downloads string
   * bundle, and whose values are either the translated strings or functions
   * returning formatted strings.
   */
Returns an object whose keys are the string names from the downloads string
bundle, and whose values are either the translated strings or functions
returning formatted strings.
Returns an object whose keys are the string names from the downloads string bundle and whose values are either the translated strings or functions returning formatted strings .
get strings()
  {
    let strings = {};
    let sb = Services.strings.createBundle(kDownloadsStringBundleUrl);
    let enumerator = sb.getSimpleEnumeration();
    while (enumerator.hasMoreElements()) {
      let string = enumerator.getNext().QueryInterface(Ci.nsIPropertyElement);
      let stringName = string.key;
      if (stringName in kDownloadsStringsRequiringFormatting) {
        strings[stringName] = function () {
          return sb.formatStringFromName(stringName,
                                         Array.slice(arguments, 0),
                                         arguments.length);
        };
      } else if (stringName in kDownloadsStringsRequiringPluralForm) {
        strings[stringName] = function (aCount) {
          let formattedString = sb.formatStringFromName(stringName,
                                         Array.slice(arguments, 0),
                                         arguments.length);
          return PluralForm.get(aCount, formattedString);
        };
      } else {
        strings[stringName] = string.value;
      }
    }
    delete this.strings;
    return this.strings = strings;
  }
get strings ( ) { let strings = { } ; let sb = Services . strings . createBundle ( kDownloadsStringBundleUrl ) ; let enumerator = sb . getSimpleEnumeration ( ) ; while ( enumerator . hasMoreElements ( ) ) { let string = enumerator . getNext ( ) . QueryInterface ( Ci . nsIPropertyElement ) ; let stringName = string . key ; if ( stringName in kDownloadsStringsRequiringFormatting ) { strings [ stringName ] = function ( ) { return sb . formatStringFromName ( stringName , Array . slice ( arguments , 0 ) , arguments . length ) ; } ; } else if ( stringName in kDownloadsStringsRequiringPluralForm ) { strings [ stringName ] = function ( aCount ) { let formattedString = sb . formatStringFromName ( stringName , Array . slice ( arguments , 0 ) , arguments . length ) ; return PluralForm . get ( aCount , formattedString ) ; } ; } else { strings [ stringName ] = string . value ; } } delete this . strings ; return this . strings = strings ; }
Returns an object whose keys are the string names from the downloads string
 bundle, and whose values are either the translated strings or functions
 returning formatted strings.
Returns an object whose keys are the string names from the downloads string bundle and whose values are either the translated strings or functions returning formatted strings .
// Convert "arguments" to a real array before calling into XPCOM. // Convert "arguments" to a real array before calling into XPCOM.