translation-badge

Renders the per-entry translation-status pill, with freshness dates and a may-lag marker, on translated wiki, article, timeline and news pages.

≈ 2 min read 342 words Updated 2026-11-21

On this page

macros/translation-badge.html exposes the render macro that surfaces the page.extra.translation_status field as a pill, with the translation’s freshness in the tooltip. Renders nothing on English pages or when no status is set. Placed in the wiki sidebar, the article and dispatch bylines, and the timeline-chapter meta column.

Source: themes/bifrost/templates/macros/translation-badge.html · visual surface: Chrome → Translation indicators

Public API#

{%/* import "macros/translation-badge.html" as translation_badge */%}

{{ translation_badge::render(
    status=page.extra.translation_status | default(value=""),
    lang=detected_lang,
    updated=page.extra.translation_updated | default(value=""),
    source=page.extra.source_updated | default(value=""),
    stale=page.extra.translation_stale | default(value=false),
    sync=page.extra.translation_sync | default(value=100)
) }}

The four freshness parameters are optional; without them the macro renders the plain status pill as before.

Status values#

StatusPill colourWhen
metadata_onlyyellowTitle + description translated; body is English.
machinemauveBody auto-translated, awaiting human pass.
ai_reviewedtealAI-translated, then independently reviewed against the English and the canon.
humanmintFull human translation.
en_onlymuted greyEnglish fallback — no translation exists yet.

Freshness and the “may lag” marker#

scripts/translation_audit.py (www) writes these into each translated page’s [extra]; re-run it after every translation pass:

FieldMeaning
translation_updatedDate of the translation’s last real change (git; bookkeeping-only commits such as version bumps don’t count).
source_updatedDate of the English page’s last real change.
translation_staletrue when the English changed after the translation.
translation_syncStructural parity with the English, 0–100: shortcodes (keyed by target — slug, book/chapter/verse, id, src) and headings shared by both, out of all that either has. Missing links and leftover sections from an older English both lower it. Measures structure, not prose.

The pill gets the --lagging modifier (dashed border, amber ring on the dot, a “may lag” suffix) when translation_stale is true or translation_sync is below 95. Both dates appear in the tooltip and the accessible label; the percentage is exposed only as data-translation-sync.

Render condition#

The macro emits no markup when either:

  • lang == "en" (English pages don’t need a translation-status pill), or
  • status is empty / unknown.

Edit this page on GitHub