Aller au contenu

validate_translations

Lint a JSON i18next blob against the project: checks for missing keys, extra keys, and placeholder parity ({var}, {{var}}, %{var}) vs the source language. Each placeholder_mismatches[] item carries expected / got plus missing (source variables absent from the translation) and extra (variables in the translation unknown to the source). Call it WITHOUT payload (just a language_code) to audit the project's STORED values before publishing: the report then carries quality_issues[] (same_as_source / wrong_language / looks_like_raw_key) and structural_issues[] (self_namespaced_key, a key prefixed by its own namespace that makes the SDK fall back to source silently). With a payload, it inspects the values you are about to submit instead. When auditing stored values, ignore missing_keys / extra_keys (empty payload makes them meaningless) and read the issue arrays.

NomTypeDescription
project_uuidstringoptionnelProject UUID. Required when multiple projects are configured (SONENTA_PROJECTS); defaults to the single configured project otherwise.
language_codestringrequis
namespacestringoptionnelRestrict to one namespace (default: all).
payloadobjectoptionnelThe translation tree to validate.
{
"tool": "validate_translations",
"arguments": {
"language_code": "<language_code>"
}
}