Riksdagsmonitor Intelligence Platform โ€” API Documentation - v1.0.30
    Preparing search index...
    • Extract the language code from a news article filename or executive-brief Markdown filename.

      Recognised patterns:

      • news/YYYY-MM-DD-slug-<lang>.html (HTML article)
      • analysis/daily/.../executive-brief_<lang>.md (Markdown translation)

      Returns null for the canonical English source executive-brief.md (no suffix) โ€” callers must handle that file via path-based ownership rules.

      Parameters

      • filepath: string

        The file path to extract the language from

      Returns string

      The two-letter language code, or null if no match