@samitouri / QOSAMI-WSL / commits / ca6c0e8d

validate-localization: downgrade ADML locked-token mismatch to warning (#40533)

The Touchdown `.adml` parser does not honor `<!-- {Locked=...} -->` XML comments the way the `.resw` parser honors `<comment>{Locked=...}</comment>`, so every nightly localization PR comes back with locked tokens translated (`Mirrored` -> `镜像`, `None` -> `Нет`, etc.) and fails CI on the per-locale token check we added in #40515. Keep the baseline en-US locked-token check and all ID/presentation parity checks as errors. Downgrade the per-locale locked-token check to a warning so loc PRs can land while we figure out the right LocVer placement for .adml with the Touchdown team. Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Ben Hillis committed May 13, 2026 at 17:39 UTC ca6c0e8d6ec59e44a4b002753a47030dedcdd268
1 file changed +8 -2
tools/devops/validate-localization.py
+8 -2
@@ -268,13 +268,19 @@ def validate_adml(adml_folder: str, baseline_language: str) -> bool:
268 print(f'error: ADML {locale_path} has unexpected presentation ids: {sorted(extra_p)}')
269 result = False
270
271 + # Note: we intentionally do not enforce that baseline {Locked="..."}
272 + # tokens appear in translated ADML strings. The Touchdown pipeline does
273 + # not honor `<!-- {Locked="..."} -->` XML comments in .adml files (it
274 + # only honors the `<comment>` element used by .resw), so locked tokens
275 + # are routinely translated. Failing CI here would block every nightly
276 + # localization PR. The baseline check above still catches authoring
277 + # mistakes in en-US.
278 for sid in baseline_ids & set(translated.keys()):
279 _, tokens = baseline[sid]
280 tvalue, _ = translated[sid]
281 for tok in tokens:
282 if tok not in tvalue:
276 - print(f'error: locked token "{tok}" not found in {locale_path} string {sid}: {tvalue}')
277 - result = False
283 + print(f'warning: locked token "{tok}" not preserved in {locale_path} string {sid}: {tvalue}')
284
285 return result
286