Skip to content

Audit .resx files: add placeholder docs and {Locked="…"} markers#9031

Merged
Evangelink merged 3 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/resx-comments-audit-v2
Jun 11, 2026
Merged

Audit .resx files: add placeholder docs and {Locked="…"} markers#9031
Evangelink merged 3 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/resx-comments-audit-v2

Conversation

@Evangelink

Copy link
Copy Markdown
Member

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 section name. {1} is the path to testconfig.json.).
  • Added {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.
  • Regenerated the corresponding .xlf files via dotnet msbuild <project> /t:UpdateXlf for all 20 shipping projects. XliffTasks correctly propagated <note> elements and re-marked affected trans-units as needs-review-translation so the loc team can revalidate existing translations against the new Locked context.

Notes

  • Microsoft.Testing.Extensions.AzureFoundry xlf is not regenerated: the project sets <IsShipping>false</IsShipping>, and Arcade's Localization.targets only wires up XliffTasks for IsShippingAssembly == true. The single new resx <comment> there will be picked up the next time UpdateXlf runs on the project.
  • No <value> text mutations across any resx — verified with raw git diff.
  • .\build.cmd passes with 0 warnings / 0 errors (validated on the original branch; this PR is a clean cherry-pick of the same commit onto current main now 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.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .resx files.
  • Regenerated corresponding .xlf files so translator notes include the new placeholder documentation and {Locked="…"} markers.
  • Updated localized .xlf targets’ state to 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

Evangelink and others added 2 commits June 11, 2026 10:49
…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>
Copilot AI review requested due to automatic review settings June 11, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 21/281 changed files
  • Comments generated: 1

@Evangelink Evangelink merged commit acb8277 into microsoft:main Jun 11, 2026
20 of 25 checks passed
@Evangelink Evangelink deleted the dev/amauryleve/resx-comments-audit-v2 branch June 11, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants