Audit .resx files: add placeholder docs and {Locked="…"} markers#9031
Merged
Evangelink merged 3 commits intoJun 11, 2026
Merged
Conversation
Audited every .resx file across the repo (21 files, ~1055 entries) and:
- Added <comment> elements documenting each {N} placeholder (what value
it carries, e.g. "{0} is the test method name. {1} is the assertion
failure message.").
- Added {Locked="..."} markers for tokens that must NOT be localized:
CLI option names (--report-trx), env var names (TF_BUILD),
attribute/type names ([TestMethod], ITestApplicationBuilder),
literal config values, file extensions, etc.
- Regenerated the corresponding .xlf files via
`dotnet msbuild <project> /t:UpdateXlf` for all 20 shipping
projects. XliffTasks marks affected trans-units as
`needs-review-translation` so the loc team can revalidate
existing translations against the new Locked context.
AzureFoundry's xlf is not regenerated because its project sets
`IsShipping=false` and Arcade only wires up XliffTasks for shipping
projects; the single resx <comment> there will be picked up the next
time the project becomes shipping or someone explicitly runs UpdateXlf
on it. No <value> mutations across any resx.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates localization resources across MSTest and Microsoft.Testing.Platform to improve translator context by documenting format placeholders and marking non-localizable tokens (via {Locked="…"}) in .resx comments, then propagating those notes into regenerated .xlf files.
Changes:
- Added/expanded
<comment>metadata for placeholders ({0},{1}, …) and non-localizable tokens (CLI options, API names, URLs, file extensions) across resource.resxfiles. - Regenerated corresponding
.xlffiles so translator notes include the new placeholder documentation and{Locked="…"}markers. - Updated localized
.xlftargets’stateto reflect that translations may need re-validation given the new locking context.
Show a summary per file
| File | Description |
|---|---|
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.pt-BR.xlf | Propagates updated translator notes/lock markers into pt-BR resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.pl.xlf | Propagates updated translator notes/lock markers into pl resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.ko.xlf | Propagates updated translator notes/lock markers into ko resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.ja.xlf | Propagates updated translator notes/lock markers into ja resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.it.xlf | Propagates updated translator notes/lock markers into it resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.fr.xlf | Propagates updated translator notes/lock markers into fr resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.es.xlf | Propagates updated translator notes/lock markers into es resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.de.xlf | Propagates updated translator notes/lock markers into de resources. |
| src/TestFramework/TestFramework.Extensions/Resources/xlf/FrameworkExtensionsMessages.cs.xlf | Propagates updated translator notes/lock markers into cs resources. |
| src/TestFramework/TestFramework.Extensions/Resources/FrameworkExtensionsMessages.resx | Adds placeholder documentation and {Locked="…"} guidance in resx comments. |
| src/Platform/Microsoft.Testing.Platform.MSBuild/Resources/MSBuildResources.resx | Adds placeholder documentation and {Locked="…"} guidance in resx comments. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.pt-BR.xlf | Propagates updated translator notes/lock markers into pt-BR resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.pl.xlf | Propagates updated translator notes/lock markers into pl resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.ko.xlf | Propagates updated translator notes/lock markers into ko resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.ja.xlf | Propagates updated translator notes/lock markers into ja resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.it.xlf | Propagates updated translator notes/lock markers into it resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.fr.xlf | Propagates updated translator notes/lock markers into fr resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.es.xlf | Propagates updated translator notes/lock markers into es resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.de.xlf | Propagates updated translator notes/lock markers into de resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/xlf/AIExtensionResources.cs.xlf | Propagates updated translator notes/lock markers into cs resources. |
| src/Platform/Microsoft.Testing.Platform.AI/Resources/AIExtensionResources.resx | Adds non-localizable token guidance in resx comments. |
| src/Platform/Microsoft.Testing.Extensions.VSTestBridge/Resources/xlf/ExtensionResources.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/Platform/Microsoft.Testing.Extensions.VSTestBridge/Resources/ExtensionResources.resx | Adds placeholder documentation and {Locked="…"} guidance in resx comments. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.pt-BR.xlf | Propagates updated translator notes/lock markers into pt-BR resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.pl.xlf | Propagates updated translator notes/lock markers into pl resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.ko.xlf | Propagates updated translator notes/lock markers into ko resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.ja.xlf | Propagates updated translator notes/lock markers into ja resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.it.xlf | Propagates updated translator notes/lock markers into it resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.fr.xlf | Propagates updated translator notes/lock markers into fr resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.es.xlf | Propagates updated translator notes/lock markers into es resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.de.xlf | Propagates updated translator notes/lock markers into de resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/xlf/ExtensionResources.cs.xlf | Propagates updated translator notes/lock markers into cs resources. |
| src/Platform/Microsoft.Testing.Extensions.Telemetry/Resources/ExtensionResources.resx | Adds non-localizable token guidance in resx comments. |
| src/Platform/Microsoft.Testing.Extensions.Retry/Resources/ExtensionResources.resx | Adds placeholder documentation and {Locked="…"} guidance in resx comments. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.pt-BR.xlf | Propagates updated translator notes/lock markers into pt-BR resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.pl.xlf | Propagates updated translator notes/lock markers into pl resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.ko.xlf | Propagates updated translator notes/lock markers into ko resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.ja.xlf | Propagates updated translator notes/lock markers into ja resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.it.xlf | Propagates updated translator notes/lock markers into it resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.fr.xlf | Propagates updated translator notes/lock markers into fr resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.es.xlf | Propagates updated translator notes/lock markers into es resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.de.xlf | Propagates updated translator notes/lock markers into de resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/xlf/ExtensionResources.cs.xlf | Propagates updated translator notes/lock markers into cs resources. |
| src/Platform/Microsoft.Testing.Extensions.MSBuild/Resources/ExtensionResources.resx | Adds non-localizable token guidance in resx comments. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.zh-Hans.xlf | Regenerated zh-Hans XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.pt-BR.xlf | Regenerated pt-BR XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.pl.xlf | Regenerated pl XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.ko.xlf | Regenerated ko XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.ja.xlf | Regenerated ja XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.it.xlf | Regenerated it XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.de.xlf | Regenerated de XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/xlf/ExtensionResources.cs.xlf | Regenerated cs XLIFF for JUnitReport. |
| src/Platform/Microsoft.Testing.Extensions.JUnitReport/Resources/ExtensionResources.resx | Adds placeholder docs and {Locked="…"} markers for JUnitReport resources. |
| src/Platform/Microsoft.Testing.Extensions.HtmlReport/Resources/ExtensionResources.resx | Adds placeholder docs and {Locked="…"} markers for HtmlReport resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.pt-BR.xlf | Propagates updated translator notes/lock markers into pt-BR resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.pl.xlf | Propagates updated translator notes/lock markers into pl resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.ko.xlf | Propagates updated translator notes/lock markers into ko resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.ja.xlf | Propagates updated translator notes/lock markers into ja resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.it.xlf | Propagates updated translator notes/lock markers into it resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.fr.xlf | Propagates updated translator notes/lock markers into fr resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.es.xlf | Propagates updated translator notes/lock markers into es resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.de.xlf | Propagates updated translator notes/lock markers into de resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/xlf/ExtensionResources.cs.xlf | Propagates updated translator notes/lock markers into cs resources. |
| src/Platform/Microsoft.Testing.Extensions.HotReload/Resources/ExtensionResources.resx | Adds non-localizable token guidance in resx comments. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.zh-Hant.xlf | Propagates updated translator notes/lock markers into zh-Hant resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.zh-Hans.xlf | Propagates updated translator notes/lock markers into zh-Hans resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.tr.xlf | Propagates updated translator notes/lock markers into tr resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.ru.xlf | Propagates updated translator notes/lock markers into ru resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.pt-BR.xlf | Propagates updated translator notes/lock markers into pt-BR resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.pl.xlf | Propagates updated translator notes/lock markers into pl resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.ko.xlf | Propagates updated translator notes/lock markers into ko resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.ja.xlf | Propagates updated translator notes/lock markers into ja resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.it.xlf | Propagates updated translator notes/lock markers into it resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.fr.xlf | Propagates updated translator notes/lock markers into fr resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.es.xlf | Propagates updated translator notes/lock markers into es resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.de.xlf | Propagates updated translator notes/lock markers into de resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/xlf/ExtensionResources.cs.xlf | Propagates updated translator notes/lock markers into cs resources. |
| src/Platform/Microsoft.Testing.Extensions.CtrfReport/Resources/ExtensionResources.resx | Adds placeholder docs and {Locked="…"} markers for CTRF resources. |
| src/Platform/Microsoft.Testing.Extensions.AzureFoundry/Resources/ExtensionResources.resx | Adds placeholder documentation in resx comments. |
Copilot's findings
- Files reviewed: 21/281 changed files
- Comments generated: 10
…ed lists
The original cherry-pick onto main triggered git auto-merges in four
extension projects whose resx files had diverged between the audit
branch and main. The merges produced two kinds of corruption:
1. Invalid/duplicate trans-units in xlf files (8 JUnitReport xlf files
had duplicate trans-unit ids; 13 HangDump xlf files were not even
well-formed XML; HtmlReport, JUnitReport, and TrxReport xlf files
had two <target>/<note> pairs in the FileNameOptionDescription
trans-unit, which is invalid XLIFF 1.2).
2. A duplicated <value> line in HangDump's resx that broke XML
well-formedness.
Fix: reset every affected xlf to origin/main, fix the HangDump resx
XML, then run UpdateXlf on the four projects so the xlf files are
regenerated cleanly from the (corrected) resx.
Also addressed the second review comment: the {Locked="{arch}"} token
was missing from the FileNameOptionDescription <comment> in HangDump,
HtmlReport, JUnitReport, and TrxReport resx files even though {arch}
appears in their <value> placeholder list. Added it everywhere for
consistency.
Verified: all 4 affected projects build clean (0 warnings, 0 errors),
all PR xlf files pass well-formedness and trans-unit-uniqueness audits,
all PR resx files are well-formed XML.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The previous regen left the xlf files semantically out of date with the resx for three projects (CI's XliffTasks freshness check failed on cs.xlf for all three). Re-running UpdateXlf now properly: - Replaces empty <note /> with the actual note text from the resx <comment> for entries that already had translated targets. - Re-marks <target state="translated"> as <target state="needs-review-translation"> since the source's note changed. Verified: clean-rebuild (after wiping artifacts/obj) of all four affected projects passes the XliffTasks freshness check. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Audited every
.resxfile across the repo (21 files, ~1055 entries) and:<comment>elements documenting each{N}placeholder (what value it carries, e.g.{0} is the section name. {1} is the path to testconfig.json.).{Locked="…"}markers for tokens that must NOT be localized: CLI option names (--report-trx), environment variable names (TF_BUILD), attribute/type names ([TestMethod],ITestApplicationBuilder), literal config values, file extensions, etc..xlffiles viadotnet msbuild <project> /t:UpdateXlffor all 20 shipping projects. XliffTasks correctly propagated<note>elements and re-marked affected trans-units asneeds-review-translationso the loc team can revalidate existing translations against the new Locked context.Notes
Microsoft.Testing.Extensions.AzureFoundryxlf is not regenerated: the project sets<IsShipping>false</IsShipping>, and Arcade'sLocalization.targetsonly wires up XliffTasks forIsShippingAssembly == true. The single new resx<comment>there will be picked up the next time UpdateXlf runs on the project.<value>text mutations across any resx — verified with rawgit diff..\build.cmdpasses with 0 warnings / 0 errors (validated on the original branch; this PR is a clean cherry-pick of the same commit onto currentmainnow that Add Microsoft.Testing.Extensions.CtrfReport extension (CTRF reporter) #8903 has merged).This PR supersedes Evangelink/testfx#2, which was mistakenly targeting a branch in my fork instead of
microsoft/testfx:main.