B2G/gaia/build/webapp-optimize.js
/**
 * Creates a dictionary for all l10n entities that are required by the HTML
 * document, and include it as an inline JSON.
 *
 * @param {HTMLDocument} doc DOM document of the file.
 * @param {Object} dictionary minimal set of strings required to translate all
 *                            elements in the HTML document that use
 *                            data-l10n-id attributes.
 */
Creates a dictionary for all l10n entities that are required by the HTML
document, and include it as an inline JSON.

@param {HTMLDocument} doc DOM document of the file.
@param {Object} dictionary minimal set of strings required to translate all
elements in the HTML document that use
data-l10n-id attributes.
Creates a dictionary for all l10n entities that are required by the HTML document and include it as an inline JSON . @param { HTMLDocument } doc DOM document of the file . @param { Object } dictionary minimal set of strings required to translate all elements in the HTML document that use data - l10n - id attributes .
function optimize_embedL10nResources(doc, dictionary) {
  if (GAIA_INLINE_LOCALES !== '1')
    return;
  for (let lang in dictionary) {
    let script = doc.createElement('script');
    script.type = 'application/l10n';
    script.lang = lang;
    script.innerHTML = '\n  ' + JSON.stringify(dictionary[lang]) + '\n';
    doc.documentElement.appendChild(script);
  }
}
function optimize_embedL10nResources ( doc , dictionary ) { if ( GAIA_INLINE_LOCALES !== '1' ) return ; for ( let lang in dictionary ) { let script = doc . createElement ( 'script' ) ; script . type = 'application/l10n' ; script . lang = lang ; script . innerHTML = '\n  ' + JSON . stringify ( dictionary [ lang ] ) + '\n' ; doc . documentElement . appendChild ( script ) ; } }
Creates a dictionary for all l10n entities that are required by the HTML
 document, and include it as an inline JSON.
Creates a dictionary for all l10n entities that are required by the HTML document and include it as an inline JSON .
// split the l10n dictionary on a per-locale basis, // and embed it in the HTML document by enclosing it in <script> nodes.