Skip to content

Localize AbsolutePath validation messages#13115

Merged
JanProvaznik merged 3 commits intodotnet:mainfrom
JanProvaznik:localize-absolutepath
Feb 6, 2026
Merged

Localize AbsolutePath validation messages#13115
JanProvaznik merged 3 commits intodotnet:mainfrom
JanProvaznik:localize-absolutepath

Conversation

@JanProvaznik
Copy link
Member

Add localization infrastructure to Microsoft.Build.Framework for AbsolutePath validation messages.

Changes

  • Created Resources/Strings.resx with localized messages for path validation
  • Created Resources/AssemblyResources.cs (FrameworkResources class) to load resources
  • Updated AbsolutePath.ValidatePath() to use localized strings

Closes #13114

Copilot AI review requested due to automatic review settings January 26, 2026 11:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds localization infrastructure to Microsoft.Build.Framework so AbsolutePath validation errors can come from resources instead of hard-coded English strings.

Changes:

  • Added Resources/Strings.resx and a FrameworkResources loader for Framework assembly resources.
  • Updated AbsolutePath.ValidatePath() to throw using resource-based strings.
  • Added Framework XLF files for multiple locales and adjusted task-environment drivers’ Wave18_4 opt-out condition.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/Framework/Resources/xlf/Strings.zh-Hant.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.zh-Hans.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.tr.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.ru.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.pt-BR.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.pl.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.ko.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.ja.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.it.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.fr.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.es.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.de.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/xlf/Strings.cs.xlf Adds Framework locale XLF entries for AbsolutePath validation messages
src/Framework/Resources/Strings.resx Introduces the Framework resource strings for AbsolutePath validation
src/Framework/Resources/AssemblyResources.cs Adds FrameworkResources helper to load localized strings
src/Framework/PathHelpers/AbsolutePath.cs Switches validation exceptions to use FrameworkResources strings
src/Framework/Microsoft.Build.Framework.csproj Embeds Resources/Strings.resx with the expected logical name
src/Build/BackEnd/TaskExecutionHost/MultiThreadedTaskEnvironmentDriver.cs Adjusts Wave18_4 opt-out path handling logic
src/Build/BackEnd/TaskExecutionHost/MultiProcessTaskEnvironmentDriver.cs Adjusts Wave18_4 opt-out path handling logic

@JanProvaznik JanProvaznik force-pushed the localize-absolutepath branch from de42c44 to 8bb486d Compare January 26, 2026 12:09
@JanProvaznik
Copy link
Member Author

drafting because it depends on #13120 and copilot has good design points

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

@JanProvaznik JanProvaznik force-pushed the localize-absolutepath branch from ae833de to 773c540 Compare January 29, 2026 13:33
Fixes dotnet#13114

- Add localization infrastructure to Microsoft.Build.Framework assembly
- Create Resources/Strings.resx with PathMustNotBeNullOrEmpty and PathMustBeRooted strings
- Add FrameworkResources class (in AssemblyResources.cs) to access resources
  Note: Class named FrameworkResources to avoid InternalsVisibleTo conflicts
- Update AbsolutePath.cs to use localized strings
- Add xlf translation files for all supported languages
- Add tests with [UseInvariantCulture] to verify error messages
@JanProvaznik JanProvaznik force-pushed the localize-absolutepath branch from 773c540 to 1d035a3 Compare January 29, 2026 13:33
@JanProvaznik JanProvaznik marked this pull request as ready for review January 29, 2026 13:52
@JanProvaznik
Copy link
Member Author

exp insertion does not report localizing as a perf regression

@JanProvaznik
Copy link
Member Author

2 reviewers wanted

@JanProvaznik JanProvaznik merged commit 74a316b into dotnet:main Feb 6, 2026
9 checks passed
JanProvaznik added a commit to JanProvaznik/msbuild that referenced this pull request Feb 25, 2026
Add localization infrastructure to Microsoft.Build.Framework for
AbsolutePath validation messages.

## Changes
- Created Resources/Strings.resx with localized messages for path
validation
- Created Resources/AssemblyResources.cs (FrameworkResources class) to
load resources
- Updated AbsolutePath.ValidatePath() to use localized strings

Closes dotnet#13114
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.

Path validation strings in AbsolutePath should be localized

4 participants