function translateElement(element) {
    var l10n = getL10nAttributes(element);
    if (!l10n.id) {
      return true;
    }

    // get the related l10n object
    var data = getL10nData(l10n.id, l10n.args);
    if (!data) {
      return false;
    }

    // translate element (TODO: security checks?)
    for (var k in data) {
      if (k === '_') {
        setTextContent(element, data._);
      } else {
        var idx = k.lastIndexOf('.');
        var nestedProp = k.substr(0, idx);
        if (gNestedProps.indexOf(nestedProp) > -1) {
          element[nestedProp][k.substr(idx + 1)] = data[k];
        } else if (k === 'ariaLabel') {
          element.setAttribute('aria-label', data[k]);
        } else {
          element[k] = data[k];
        }
      }
    }
    return true;
  }
// -- returns true if the element could be translated, false otherwise
returns true if the element could be translated, false otherwise
returns true if the element could be translated false otherwise
function translateElement(element) {
    var l10n = getL10nAttributes(element);
    if (!l10n.id) {
      return true;
    }
    var data = getL10nData(l10n.id, l10n.args);
    if (!data) {
      return false;
    }
    for (var k in data) {
      if (k === '_') {
        setTextContent(element, data._);
      } else {
        var idx = k.lastIndexOf('.');
        var nestedProp = k.substr(0, idx);
        if (gNestedProps.indexOf(nestedProp) > -1) {
          element[nestedProp][k.substr(idx + 1)] = data[k];
        } else if (k === 'ariaLabel') {
          element.setAttribute('aria-label', data[k]);
        } else {
          element[k] = data[k];
        }
      }
    }
    return true;
  }
function translateElement ( element ) { var l10n = getL10nAttributes ( element ) ; if ( ! l10n . id ) { return true ; } var data = getL10nData ( l10n . id , l10n . args ) ; if ( ! data ) { return false ; } for ( var k in data ) { if ( k === '_' ) { setTextContent ( element , data . _ ) ; } else { var idx = k . lastIndexOf ( '.' ) ; var nestedProp = k . substr ( 0 , idx ) ; if ( gNestedProps . indexOf ( nestedProp ) > - 1 ) { element [ nestedProp ] [ k . substr ( idx + 1 ) ] = data [ k ] ; } else if ( k === 'ariaLabel' ) { element . setAttribute ( 'aria-label' , data [ k ] ) ; } else { element [ k ] = data [ k ] ; } } } return true ; }
returns true if the element could be translated, false otherwise
returns true if the element could be translated false otherwise
// get the related l10n object // translate element (TODO: security checks?)