translate Attribute Inheritance

Resolves translate yes/no and inherited translation mode. Empty means yes, invalid and omitted values inherit; supply true as the parent mode for a root element without an ancestor.

Description

The translate attribute controls whether an element’s text and translatable attribute values participate in translation.

The translate attribute controls whether an element’s text and translatable attribute values participate in translation. Its inherited mode differs from an explicit yes or no.1

The tool returns attributeState, translate. The fields describe the supplied local pattern or effective state, or contain the formatted markup shown below.

When to use translate Attribute Inheritance

Use this for the following task: Resolves translate yes/no and inherited translation mode. Empty means yes, invalid and omitted values inherit; supply true as the parent mode for a root element without an ancestor. Provide the requested local fields extracted from the relevant element or attribute.

How to use translate Attribute Inheritance and understand its results

  1. Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
  2. Enter present, value, parentTranslate according to the field table, then run the tool.
  3. Read attributeState, translate. Check the effective state, recognized-token flags or generated markup against the rules below.
  4. Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
Input fieldMeaningValue type and boundsRequirement
presentPresentbooleanRequired
valueValuestring; maximum text length 100000Required
parentTranslateParent TranslatebooleanRequired

Provide presence, attribute value and parentTranslate. Resolve the attribute state and use the parent flag only for inherit.

absent/invalid → inherit; empty/yes → yes; no → no

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
attributeStateAttribute Statestring
translateTranslateboolean
json
{
  "input": {
    "present": false,
    "value": "",
    "parentTranslate": false
  },
  "output": {
    "attributeState": "inherit",
    "translate": false
  }
}

Limitations and assumptions

The present flag distinguishes an absent attribute from a present empty value. Keyword matching folds ASCII uppercase without trimming. Supply true for a root without an ancestor. No translation is performed.

The tool does not fetch a page, run a browser or validate an entire HTML document. Malformed tool requests produce input errors; valid requests can still report unrecognized values or failed local checks.

Alternative or Complementary methods

Choose contenteditable Inheritance Behavior when you need its operation: Resolves contenteditable attribute state and whether ordinary element contents are editable using a caller-supplied inherited editable flag. Empty means true and invalid/omitted values inherit. DesignMode, rich-formatting inheritance and unrelated inertness are separate. Choose spellcheck Tri-State Inherit Default for the complementary operation: Resolves spellcheck attribute and IDL flag using caller-supplied true, false or inherit default behavior and parent flag. Missing/invalid attributes use the default behavior, which need not inherit. This does not override user preferences or decide which text is checkable.

Background reference: HTML Standard: translate Attribute Inheritance.

References

  1. HTML Standard: translate Attribute Inheritance — WHATWG

Similar or alternative tools

  • contenteditable Inheritance Behavior

    Resolves contenteditable attribute state and whether ordinary element contents are editable using a caller-supplied inherited editable flag. Empty means true and invalid/omitted values inherit. DesignMode, rich-formatting inheritance and unrelated inertness are separate.

  • spellcheck Tri-State Inherit Default

    Resolves spellcheck attribute and IDL flag using caller-supplied true, false or inherit default behavior and parent flag. Missing/invalid attributes use the default behavior, which need not inherit. This does not override user preferences or decide which text is checkable.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies