Fix bad merge in MSTest.Analyzers xlf files#8636
Conversation
Two OneLocBuild check-ins corrupted the `TestContextShouldBeValidDescription` trans-unit in all 13 language xlf files for `MSTest.Analyzers`: - 41fd1ac added a stray `<target state=""new"">English text</target>` element, producing two `<target>` elements in a single `<trans-unit>`. This violates the xliff 1.2 schema and broke the build with: `error : The element 'trans-unit' ... has invalid child element 'target' ...` - c27a8f1 then overwrote the existing localized translation with the Czech text in all 12 non-Czech language files. Restore the trans-unit to its pristine pre-bad-merge state (from 561ebf7) for all 13 affected files. This: - Removes the duplicate `<target>` so each `<trans-unit>` has exactly one target (fixes the XSD validation error). - Restores the proper per-language translation that was overwritten with Czech. Verified by building `MSTest.Analyzers.csproj` (0 warnings, 0 errors) and by XML-parsing every xlf file in the repository to confirm no `<trans-unit>` has more than one `<target>`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a corrupted TestContextShouldBeValidDescription trans-unit in the MSTest.Analyzers localized .xlf files (introduced by bad OneLocBuild merges), restoring schema-valid XLIFF 1.2 structure and per-language translations so the analyzers project builds again.
Changes:
- Removes the duplicate
<target>element from the affectedtrans-unit(restoring XLIFF 1.2 validity). - Restores the correct per-language localized
<target>content that had been overwritten across multiple languages.
Show a summary per file
| File | Description |
|---|---|
| src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf | Removes the stray duplicate <target> in the affected trans-unit. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct German translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Spanish translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct French translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Italian translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Japanese translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Korean translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Polish translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Portuguese (Brazil) translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Russian translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Turkish translation. |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf | Restores TestContextShouldBeValidDescription to a single <target> (but see review comment about incorrect wording). |
| src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf | Restores TestContextShouldBeValidDescription to a single <target> with correct Traditional Chinese translation. |
Copilot's findings
- Files reviewed: 13/13 changed files
- Comments generated: 1
Evangelink
left a comment
There was a problem hiding this comment.
✅ 21/21 dimensions clean — no findings.
This PR correctly fixes a critical build-blocking schema violation in 13 localization files. The fix:
- ✅ Removes duplicate
<target>elements that violated XLIFF 1.2 schema - ✅ Restores proper per-language translations (removes Czech text from 12 non-Czech files)
- ✅ Verified via XML parsing: All trans-units now have exactly 0 or 1 target elements
- ✅ Proper scope: Only the 13 affected
.xlffiles, no unrelated changes - ✅ Well-documented: Clear root cause analysis and verification steps
Note on manual .xlf editing: While the codebase rule is "never manually edit *.xlf files — build generates them," this PR is a justified exception. The automated OneLocBuild tooling introduced corruption that broke the build. Manual restoration to a known-good state is the correct fix for this scenario.
The fix has been validated:
- All 13 language files have exactly 1
<target>perTestContextShouldBeValidDescriptiontrans-unit - Czech file retains Czech text, all other files have their proper language-specific translations
- No schema violations remain
Generated by Expert Code Review (on open) for issue #8636 · ● 8.5M
Problem
Two recent OneLocBuild check-ins corrupted the
TestContextShouldBeValidDescriptiontrans-unit in all 13 language xlf files forMSTest.Analyzers, breaking the build with:Root cause
<target state=""new"">English text</target>element, producing two<target>elements in a single<trans-unit>. This violates the xliff 1.2 schema and is what the compiler error above is about.Fix
Restore the
TestContextShouldBeValidDescriptiontrans-unit to its pristine pre-bad-merge state (taken from commit 561ebf7) for all 13 affected files. This:<target>so each<trans-unit>has exactly one target (fixes the XSD validation error).Verification
MSTest.Analyzers.csprojlocally: 0 warnings, 0 errors..xlffile undersrc/andtest/and verified that no<trans-unit>has more than one<target>.