code: function createLocalization(defaultLocale, availableLangs, resIds, name) {
    // This function is called by `Localization` class to retrieve an array of
    // `ResourceBundle`s.
    function requestBundles(requestedLangs = navigator.languages) {
      const newLangs = negotiateLanguages(
        requestedLangs, availableLangs, { defaultLocale }
      );
  
      const bundles = newLangs.map(
        lang => new ResourceBundle(lang, resIds)
      );
  
      return Promise.resolve(bundles);
    }
  
    if (name === 'main') {
      document.l10n = new DocumentLocalization(requestBundles, createContext);
      document.l10n.ready = documentReady().then(() => {
        document.l10n.connectRoot(document.documentElement);
        return document.l10n.translateDocument();
      }).then(() => {
        window.addEventListener('languagechange', document.l10n);
      });
    } else {
      // Pass the main Localization, `document.l10n`, as the observer.
      const l10n = new DOMLocalization(
        requestBundles, createContext, name, document.l10n
      );
      // Add this Localization as a delegate of the main one.
      document.l10n.delegates.set(name, l10n);
    }
  }
docs: Called for every named Localization declared via <link name=…> elements.