EU Parliament Monitor - API Documentation - v0.8.2
    Preparing search index...

    Function validateTranslationCompleteness

    • Validate translation completeness and cultural adaptation for a generated article.

      Checks performed:

      • RTL languages (ar, he): Verify dir="rtl" on <html>, detect bidi control markers
      • CJK languages (ja, ko, zh): Check that content has sufficient CJK character density (high ASCII ratio suggests the article was not actually translated)
      • All non-English: Detect common English phrases that should have been translated

      This function is purely analytical — no AI calls. It produces warnings only and never blocks article generation.

      Parameters

      • html: string

        Complete HTML string of the generated article

      • lang: string

        Language code of the article (e.g. "ar", "ja", "en")

      Returns TranslationValidationResult

      Structured translation validation result with warnings and metrics