function localizeElement(element, id, args) {
    if (!element) {
      return;
    }

    if (!id) {
      element.removeAttribute('data-l10n-id');
      element.removeAttribute('data-l10n-args');
      setTextContent(element, '');
      return;
    }

    // set the data-l10n-[id|args] attributes
    element.setAttribute('data-l10n-id', id);
    if (args && typeof args === 'object') {
      element.setAttribute('data-l10n-args', JSON.stringify(args));
    } else {
      element.removeAttribute('data-l10n-args');
    }

    // if l10n resources are ready, translate now;
    // if not, the element will be translated along with the document anyway.
    if (gReadyState === 'complete') {
      translateElement(element);
    }
  }
// localize an element as soon as mozL10n is ready
localize an element as soon as mozL10n is ready
localize an element as soon as mozL10n is ready
function localizeElement(element, id, args) {
    if (!element) {
      return;
    }
    if (!id) {
      element.removeAttribute('data-l10n-id');
      element.removeAttribute('data-l10n-args');
      setTextContent(element, '');
      return;
    }
    element.setAttribute('data-l10n-id', id);
    if (args && typeof args === 'object') {
      element.setAttribute('data-l10n-args', JSON.stringify(args));
    } else {
      element.removeAttribute('data-l10n-args');
    }
    if (gReadyState === 'complete') {
      translateElement(element);
    }
  }
function localizeElement ( element , id , args ) { if ( ! element ) { return ; } if ( ! id ) { element . removeAttribute ( 'data-l10n-id' ) ; element . removeAttribute ( 'data-l10n-args' ) ; setTextContent ( element , '' ) ; return ; } element . setAttribute ( 'data-l10n-id' , id ) ; if ( args && typeof args === 'object' ) { element . setAttribute ( 'data-l10n-args' , JSON . stringify ( args ) ) ; } else { element . removeAttribute ( 'data-l10n-args' ) ; } if ( gReadyState === 'complete' ) { translateElement ( element ) ; } }
localize an element as soon as mozL10n is ready
localize an element as soon as mozL10n is ready
// set the data-l10n-[id|args] attributes // if l10n resources are ready, translate now; // if not, the element will be translated along with the document anyway.