How protected markers preserve inline structure

Protected markers let a translator change the wording of a complete sentence without rewriting the source HTML inside it. POM Translate uses them for supported inline elements such as links, emphasis, spans, code, superscript, images, and marked text.

A marker represents source-controlled markup

Suppose the source contains:

Read our <a href="/menu/"><strong>seasonal menu</strong></a>.

The translator needs the complete sentence so the link phrase can move naturally. POM Translate temporarily represents the opening and closing inline elements with numbered markers while storing the original tag names and attributes in a protected map.

The translation interface may therefore show a value conceptually similar to:

Read our %1%%2%seasonal menu%/2%%/1%.

The words can change order. The markers must remain paired and balanced so the link and emphasis can be restored.

What translators may change

Editors can:

  • translate the prose between markers;
  • move a complete opening/closing marker pair with its phrase;
  • change sentence order around protected elements;
  • leave the value empty to use the source fallback.

Editors must not:

  • delete a required marker;
  • invent a new marker number;
  • duplicate a marker pair;
  • turn an opening marker into a closing marker;
  • break nesting between two inline elements;
  • translate or edit the marker characters themselves.

The source controls the tag name and saved attributes. Link localization happens later through the URL system; the translator does not replace an href by editing a protected marker.

Void elements use one marker

Elements without closing tags, such as supported inline images, use a single protected marker. Their structural attributes stay in the source map, while separately supported human-facing attributes such as alternative text can have their own translation row.

This distinction prevents image markup from being rebuilt from a translated sentence while still allowing its accessible text to be localized.

Validation runs before storage and rendering

POM Translate compares translated markers with the source expectations. The validation checks required identifiers, opening and closing counts, balance, nesting, and malformed token-like text.

The translation interface reports marker problems before accepting an invalid manual value. Machine-translation responses and translation API writes are also checked.

At render time, POM Translate validates again. If a stored target value has invalid markers, the plugin records the validation problem for diagnostics and uses the original source unit instead of restoring unsafe or incomplete markup.

Markers do not preserve the entire page

Protected markers operate inside one translation unit. The content skeleton has a different responsibility:

  • the skeleton preserves the order of paragraphs, headings, attributes, and shortcode values;
  • the marker map preserves inline elements within one of those values.

Do not use one mechanism to reason about the other. A correctly paired link marker cannot move its paragraph to another part of the page.

Correct a marker error

When a row reports missing, extra, or unbalanced markers:

  1. compare the target field with Original Text;
  2. identify every numbered opening, closing, and standalone marker;
  3. restore the exact required set;
  4. move only complete pairs;
  5. save the translation again;
  6. reload the row and confirm the warning is gone;
  7. inspect the target page’s links, emphasis, images, and inline styles.

If the source markup itself is wrong, repair it in the canonical post and save the post again. Do not compensate for broken source HTML by constructing a different marker pattern in the target translation.

A practical verification example

Use a paragraph containing a linked phrase inside emphasis and an inline image:

  1. save the source post and open its translation rows;
  2. translate the sentence without touching marker IDs;
  3. move the linked phrase to a natural target-language position;
  4. save and inspect the public HTML;
  5. confirm the link, emphasis, and image structure match the source;
  6. deliberately remove one marker in a staging copy;
  7. confirm the interface rejects or flags the value and the public renderer does not output damaged markup.

Protected markers are a structural contract. Treat them like punctuation supplied by the system, not like words awaiting translation.