src/third_party/mozjs/extract/intl/l10n/Localization.jsm
/**
   * This method should be called when there's a reason to believe
   * that language negotiation or available resources changed.
   *
   * @param {Array<String>}    resourceIds - List of resource ids used by this
   *                                         localization.
   * @param {bool}                  isSync - Whether the instance should be
   *                                         synchronous.
   * @param {bool}                   eager - whether the I/O for new context should begin eagerly
   * @param {Function}     generateBundles - Custom FluentBundle asynchronous generator.
   * @param {Function} generateBundlesSync - Custom FluentBundle generator.
   * @returns {Iter<FluentBundle>}
   */
This method should be called when there's a reason to believe
that language negotiation or available resources changed.

@param {Array}    resourceIds - List of resource ids used by this
localization.
@param {bool}                  isSync - Whether the instance should be
synchronous.
@param {bool}                   eager - whether the I/O for new context should begin eagerly
@param {Function}     generateBundles - Custom FluentBundle asynchronous generator.
@param {Function} generateBundlesSync - Custom FluentBundle generator.
@returns {Iter}
This method should be called when there ' s a reason to believe that language negotiation or available resources changed . @param { Array } resourceIds - List of resource ids used by this localization . @param { bool } isSync - Whether the instance should be synchronous . @param { bool } eager - whether the I / O for new context should begin eagerly @param { Function } generateBundles - Custom FluentBundle asynchronous generator . @param { Function } generateBundlesSync - Custom FluentBundle generator . @returns { Iter }
generateBundles(resourceIds, isSync, eager = false, generateBundles = defaultGenerateBundles, generateBundlesSync = defaultGenerateBundlesSync) {
    let generateMessages = isSync ? generateBundlesSync : generateBundles;
    let bundles = this.cached(generateMessages(resourceIds), isSync);
    if (eager) {
      const appLocale = Services.locale.appLocaleAsBCP47;
      const lastFallback = Services.locale.lastFallbackLocale;
      const prefetchCount = appLocale === lastFallback ? 1 : 2;
      bundles.touchNext(prefetchCount);
    }
    return bundles;
  }
generateBundles ( resourceIds , isSync , eager = false , generateBundles = defaultGenerateBundles , generateBundlesSync = defaultGenerateBundlesSync ) { let generateMessages = isSync ? generateBundlesSync : generateBundles ; let bundles = this . cached ( generateMessages ( resourceIds ) , isSync ) ; if ( eager ) { const appLocale = Services . locale . appLocaleAsBCP47 ; const lastFallback = Services . locale . lastFallbackLocale ; const prefetchCount = appLocale === lastFallback ? 1 : 2 ; bundles . touchNext ( prefetchCount ) ; } return bundles ; }
This method should be called when there's a reason to believe
 that language negotiation or available resources changed.
This method should be called when there ' s a reason to believe that language negotiation or available resources changed .
// Store for error reporting from `formatWithFallback`. // If the first app locale is the same as last fallback // it means that we have all resources in this locale, and // we want to eagerly fetch just that one. // Otherwise, we're in a scenario where the first locale may // be partial and we want to eagerly fetch a fallback as well.