Skip to content

verifyDirectivesPreserved

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/apps/api/src/l10n/translation-format.ts

Every protected segment of the source must appear VERBATIM in the translation, in the same order (ordered-subsequence match — a model that reorders code blocks is as broken as one that translates them). Directive lines are compared trimmed; fenced blocks byte-exact line-by-line (modulo trailing whitespace per line, which models routinely normalize).

Signature

ts
function verifyDirectivesPreserved(source: string, translated: string): DirectiveCheck

Parameters

NameType
sourcestring
translatedstring

Returns: DirectiveCheck

Was this page helpful?

Download as PDF