function isAttrNameLocalizable(name, element, explicitlyAllowed = null) {
  if (explicitlyAllowed && explicitlyAllowed.includes(name)) {
    return true;
  }

  const allowed = LOCALIZABLE_ATTRIBUTES[element.namespaceURI];
  if (!allowed) {
    return false;
  }

  const attrName = name.toLowerCase();
  const elemName = element.localName;

  // Is it a globally safe attribute?
  if (allowed.global.includes(attrName)) {
    return true;
  }

  // Are there no allowed attributes for this element?
  if (!allowed[elemName]) {
    return false;
  }

  // Is it allowed on this element?
  if (allowed[elemName].includes(attrName)) {
    return true;
  }

  // Special case for value on HTML inputs with type button, reset, submit
  if (
    element.namespaceURI === "http://www.w3.org/1999/xhtml" &&
    elemName === "input" &&
    attrName === "value"
  ) {
    const type = element.type.toLowerCase();
    if (type === "submit" || type === "button" || type === "reset") {
      return true;
    }
  }

  return false;
}
Check if attribute is allowed for the given element.

This method is used by the sanitizer when the translation markup contains
DOM attributes, or when the translation has traits which map to DOM
attributes.

`explicitlyAllowed` can be passed as a list of attributes explicitly
allowed on this element.

@param   {string}         name
@param   {Element}        element
@param   {Array}          explicitlyAllowed
@returns {boolean}
@private