B2G/gaia/build/webapp-optimize.js
/**
 * Replaces all external l10n resource nodes by a single link:
 * <link type="application/l10n" href="/locales-obj/{{locale}}.json" />,
 * and merge the document dictionary into the webapp dictionary.
 *
 * @param {HTMLDocument} doc DOM document of the file.
 * @param {Object} webapp details of current web app.
 * @param {Object} dictionary full, multi-locale dictionary containing all
 *                            strings that are loaded by the HTML document.
 */
Replaces all external l10n resource nodes by a single link:
,
and merge the document dictionary into the webapp dictionary.

@param {HTMLDocument} doc DOM document of the file.
@param {Object} webapp details of current web app.
@param {Object} dictionary full, multi-locale dictionary containing all
strings that are loaded by the HTML document.
Replaces all external l10n resource nodes by a single link : and merge the document dictionary into the webapp dictionary . @param { HTMLDocument } doc DOM document of the file . @param { Object } webapp details of current web app . @param { Object } dictionary full multi - locale dictionary containing all strings that are loaded by the HTML document .
function optimize_concatL10nResources(doc, webapp, dictionary) {
  if (GAIA_CONCAT_LOCALES !== '1')
    return;
  var resources = doc.querySelectorAll('link[type="application/l10n"]');
  if (resources.length) {
    let jsonLink = doc.createElement('link');
    jsonLink.href = '/locales-obj/{{locale}}.json';
    jsonLink.type = 'application/l10n';
    jsonLink.rel = 'prefetch';
    let link = resources[0];
    link.parentNode.insertBefore(jsonLink, link);
    for (let i = 0; i < resources.length; i++) {
      link = resources[i];
      link.parentNode.removeChild(link);
    }
  }
  for (let lang in dictionary) {
    for (let id in dictionary[lang]) {
      webapp.dictionary[lang][id] = dictionary[lang][id];
    }
  }
}
function optimize_concatL10nResources ( doc , webapp , dictionary ) { if ( GAIA_CONCAT_LOCALES !== '1' ) return ; var resources = doc . querySelectorAll ( 'link[type="application/l10n"]' ) ; if ( resources . length ) { let jsonLink = doc . createElement ( 'link' ) ; jsonLink . href = '/locales-obj/{{locale}}.json' ; jsonLink . type = 'application/l10n' ; jsonLink . rel = 'prefetch' ; let link = resources [ 0 ] ; link . parentNode . insertBefore ( jsonLink , link ) ; for ( let i = 0 ; i < resources . length ; i ++ ) { link = resources [ i ] ; link . parentNode . removeChild ( link ) ; } } for ( let lang in dictionary ) { for ( let id in dictionary [ lang ] ) { webapp . dictionary [ lang ] [ id ] = dictionary [ lang ] [ id ] ; } } }
Replaces all external l10n resource nodes by a single link:
 <link type="application/l10n" href="/locales-obj/{{locale}}.json" />,
 and merge the document dictionary into the webapp dictionary.
Replaces all external l10n resource nodes by a single link : <link type = " application / l10n " href = " / locales - obj / {{ locale }} . json " / > and merge the document dictionary into the webapp dictionary .
// merge the l10n dictionary into webapp.dictionary