Skip to content

Allow localized quotation marks in resource strings - #11111

Merged
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
evangelink-assess-localization-status
Sep 8, 2026
Merged

Allow localized quotation marks in resource strings#11111
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
evangelink-assess-localization-status

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

  • remove apostrophes from 152 {Locked="…"} markers where the bare invariant token is already unique in its resource value
  • retain the 29 quote-wrapped markers that require punctuation to avoid substring collisions
  • regenerate XLF notes for all nine affected projects
  • update localization guidance to prefer bare invariant tokens so translators can use locale-appropriate quotation marks

Validation

  • confirmed no safely removable quote-wrapped locks remain
  • validated all 663 generated XLF units: source and target text are unchanged
  • 194 untranslated targets remain new; 469 translated targets move to needs-review-translation because their localization note changed
  • parsed all 140 changed RESX/XLF files as XML
  • git diff --check passes

Remove apostrophes from 152 localization locks where the bare invariant token is already unambiguous. Retain punctuation for the 29 collision-sensitive locks, regenerate affected XLF notes, and document the conditional rule.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 63c25c36-0fb9-4605-86fa-e2152aa7588b
Copilot AI balanced review requested due to automatic review settings September 8, 2026 08:27

@github-actions github-actions Bot 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.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Review Summary

Clean, well-scoped localization hygiene change. No blocking issues found across all 22 review dimensions.

What this PR does

Removes unnecessary quote-wrapping from 152 {Locked="..."} markers where the bare invariant token is already unique in its resource value, freeing translators to use locale-appropriate quotation marks. The 29 markers that must retain punctuation to avoid substring collisions (e.g. 'Assert' vs StringAssert/CollectionAssert, 'Dispose' vs DisposeAsync) are correctly preserved.

Key verification points

Check Result
Retained 'Assert' quotes (collision with StringAssert, CollectionAssert) ✅ Correct
Retained 'Dispose' quotes (collision with DisposeAsync) ✅ Correct
XLF <source> text unchanged (no manual xlf edits) ✅ Confirmed
XLF <note> elements updated via UpdateXlf ✅ 469 needs-review-translation, 194 new
Docs updated consistently (copilot-instructions.md, expert-reviewer.agent.md)
No new public API surface
No behavioral change

Dimension Verdict

# Dimension Verdict
1 Public API ✅ N/A
2 No init ✅ N/A
3 Localization ✅ Clean — collisions correctly identified and preserved
4 Test Architecture ✅ N/A
5 IPC Protocol ✅ N/A
6 Analyzer IDs ✅ N/A
7 Thread Safety ✅ N/A
8 Naming ✅ N/A
9 Performance ✅ N/A
10 Error Handling ✅ N/A
11 Cancellation ✅ N/A
12 Async ✅ N/A
13 Security ✅ N/A
14 Cross-TFM ✅ N/A
15 Backward Compat ✅ No behavioral change
16 Disposal ✅ N/A
17 Logging ✅ N/A
18 Config / Options ✅ N/A
19 Documentation ✅ Updated guidance in 2 docs
20 Code Style ✅ Clean
21 Build Infra ✅ N/A
22 PowerShell ✅ N/A

Result: No blocking issues. The substring-collision analysis is sound and the documentation updates are consistent with the code changes.

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 review overview

🟡 Changes recommended

At least one updated resource comment still locks quote-wrapped option text ({Locked="'off'"}) where a bare lock appears safe, undermining the PR’s goal of allowing localized quotation marks.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​TerminalResources.resxTerminalAnsiOptionDescription still locks the option value as {Locked=&quot;&#39;off&#39;&quot;} (including the…
What changed in this PR

This PR refines localization lock-marker guidance and updates generated localization artifacts so translators can use locale-appropriate quotation marks while still keeping invariant tokens (CLI values, placeholders, option names) protected.

Changes:

  • Removes unnecessary quote-wrapping from many {Locked="…"} markers while retaining punctuation only where needed to avoid substring collisions.
  • Regenerates the affected *.xlf files to reflect updated .resx notes/comments without changing source/target text.
  • Updates repository guidance (.github/…) to prefer bare invariant tokens and only include punctuation when required for collision avoidance.
File Description
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​xlf/​TerminalResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​TerminalResources.resx Adjusted {Locked="…"} markers in resource comments.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.zh-Hant.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.tr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.ja.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​xlf/​ExtensionResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.TrxReport/​Resources/​ExtensionResources.resx Adjusted {Locked="…"} markers in resource comments.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.zh-Hant.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.tr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.ja.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​xlf/​ExtensionResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.JUnitReport/​Resources/​ExtensionResources.resx Adjusted {Locked="…"} markers in resource comments.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.zh-Hant.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.tr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.ja.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​xlf/​ExtensionResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.HtmlReport/​Resources/​ExtensionResources.resx Adjusted {Locked="…"} markers in resource comments.
src/​Platform/​Microsoft.Testing.Extensions.GitHubActionsReport/​Resources/​GitHubActionsResources.resx Updated {Locked="…"} markers to reduce quote-locking.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.zh-Hant.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.tr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.ja.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​xlf/​ExtensionResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CtrfReport/​Resources/​ExtensionResources.resx Adjusted {Locked="…"} markers in resource comments.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.zh-Hant.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.tr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.ja.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​xlf/​CrashDumpResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Platform/​Microsoft.Testing.Extensions.CrashDump/​Resources/​CrashDumpResources.resx Adjusted {Locked="…"} markers in resource comments.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.zh-Hant.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.zh-Hans.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.tr.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.ru.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.pt-BR.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.pl.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.ko.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.ja.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.it.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.fr.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.es.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.de.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​xlf/​CodeFixResources.cs.xlf Updated lock notes to prefer bare tokens.
src/​Analyzers/​MSTest.Analyzers.CodeFixes/​CodeFixResources.resx Adjusted {Locked="…"} markers in resource comments.
.github/​copilot-instructions.md Updated localization guidance for {Locked="…"} usage.
.github/​agents/​expert-reviewer.agent.md Updated reviewer guidance/checklist for lock-marker usage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Use a bare localization lock for off in the ANSI option description and regenerate TerminalResources XLF notes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 63c25c36-0fb9-4605-86fa-e2152aa7588b
Copilot AI review requested due to automatic review settings September 8, 2026 09:02

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 review overview

🔵 Needs a closer look

At least one updated {Locked="…"} marker still forces ASCII quotation marks where punctuation does not appear necessary, which undermines the PR’s stated localization goal and should be corrected with corresponding XLF regeneration.

Review tier: Lite
Findings: None

Issues resolved since last review (1)
Severity Finding
Low severity src/​Platform/​Microsoft.Testing.Platform/​OutputDevice/​Terminal/​TerminalResources.resxTerminalAnsiOptionDescription still locks the option value as {Locked=&quot;&#39;off&#39;&quot;} (including the… View resolved comment
Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/Platform/Microsoft.Testing.Extensions.GitHubActionsReport/Resources/GitHubActionsResources.resx:150

  • HistoryWindowRequiresHistory still locks the option name as {Locked="'--report-gh-history'"} (including the ASCII quotes). This prevents localizers from using locale-appropriate quotation marks around the option, and the quotes don’t seem necessary here because the only substring collision is with another invariant option name (--report-gh-history-window), not with a translatable word. Consider switching this to {Locked="--report-gh-history"} (keeping {Locked="--report-gh-history-window"}) and regenerating the corresponding *.xlf notes.

@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Sep 8, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit 63b83a9 into main Sep 8, 2026
32 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the evangelink-assess-localization-status branch September 8, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants