Riksdagsmonitor Intelligence Platform โ€” API Documentation - v0.8.68
    Preparing search index...
    • Emit a Swedish-language span.

      The span always carries both the lang="sv" accessibility attribute AND data-translate="true" so that translateSwedishContent() (in translation-dictionary.ts) can locate every Swedish phrase, look it up in the per-language dictionary, and replace or clean the marker before the article is written to disk.

      • SV articles: the marker lets validation tooling verify original text is present; translateSwedishContent() strips the marker but keeps the Swedish text unchanged.
      • Non-SV articles: translateSwedishContent() attempts dictionary translation via translatePhrase() and removes the marker regardless of whether a match was found, so no data-translate attributes remain in the final HTML.

      Parameters

      • escapedText: string

        Already HTML-escaped text content

      • _lang: string

        Target article language (kept only for backward compatibility; currently not used by this function)

        When the environment variable SVSPAN_STRICT=1 is set, this function throws when called for a non-Swedish, non-English target language. This forces the architectural split described in analysis/agentic-workflow-quality-plan ยงP0-1: scripts must never emit untranslated Swedish into a target-language article โ€” AI translation of titles/summaries must happen upstream. Strict mode is opt-in so that existing test suites continue to pass unchanged; agentic workflows will enable it via their runtimes.env block once the upstream translation contract (see news-translate.md) is in place.

      Returns string