translateRoot(root) {
    return this.translateRootContent(root).then(
      () => this.interactive
    ).then(bundles => {
      const langs = bundles.map(bundle => bundle.lang);
      const wasLocalizedBefore = root.hasAttribute('langs');

      root.setAttribute('langs', langs.join(' '));
      root.setAttribute('lang', langs[0]);
      root.setAttribute('dir', getDirection(langs[0]));

      if (wasLocalizedBefore) {
        root.dispatchEvent(new CustomEvent('DOMRetranslated', {
          bubbles: false,
          cancelable: false,
        }));
      }
    });
  }
Translate `root`.

This is similar to `translateFragment` but it will also set the `lang` and
`dir` attribute on `root`.  In XUL documents, the anonymous content
attached to `root` will also be translated.

@returns {Promise}