Repository navigation
Add StrContains for language modes used in resource strings - #28339
Merged
Dongbo Wang (daxian-dbw) merged 2 commits intoNov 5, 2026
Merged
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the localization constraints and resource-message updates.
No open issues 🎉
What changed in this PR
This PR adds localization constraints to PowerShell resource strings so language-mode names remain unchanged in translations. It updates resource metadata and message wording without changing execution logic.
Changes:
- Add
StrContainsannotations for language modes and related PowerShell keywords and identifiers. - Standardize message text to use
NoLanguage,RestrictedLanguage,ConstrainedLanguage, andFullLanguage. - Remove stray quotation marks from three module log titles.
| File | Description |
|---|---|
| src/System.Management.Automation/resources/SessionStateStrings.resx | Protect the language-mode name in the variable-scope log message. |
| src/System.Management.Automation/resources/SecuritySupportStrings.resx | Protect the language-mode name in the script-trust log message. |
| src/System.Management.Automation/resources/RunspaceStrings.resx | Standardize and protect NoLanguage in the session error. |
| src/System.Management.Automation/resources/RemotingErrorIdStrings.resx | Protect session language-mode choices and normalize a log message. |
| src/System.Management.Automation/resources/ParserStrings.resx | Normalize language-mode names and protect parser keywords and identifiers. |
| src/System.Management.Automation/resources/ParameterBinderStrings.resx | Normalize and protect language-mode names in binding logs. |
| src/System.Management.Automation/resources/Modules.resx | Protect language-mode names and remove stray quotes from log titles. |
| src/System.Management.Automation/resources/Metadata.resx | Protect ValidateTrustedData and normalize the language-mode name. |
| src/System.Management.Automation/resources/InternalCommandStrings.resx | Normalize and protect language-mode names in command messages. |
| src/System.Management.Automation/resources/ExtendedTypeSystem.resx | Protect language-mode names in type-conversion logs. |
| src/System.Management.Automation/resources/CommandBaseStrings.resx | Protect language-mode names in dot-source and command-search logs. |
| src/System.Management.Automation/resources/AutomationExceptions.resx | Normalize and protect the language-mode name in the script-block log. |
| src/Microsoft.PowerShell.Commands.Utility/resources/UtilityCommonStrings.resx | Protect Invoke-Expression and ConstrainedLanguage. |
| src/Microsoft.PowerShell.Commands.Utility/resources/NewObjectStrings.resx | Protect language-mode names and COM in object-creation logs. |
| src/Microsoft.PowerShell.Commands.Utility/resources/ImportLocalizedDataStrings.resx | Protect SupportedCommand and ConstrainedLanguage. |
| src/Microsoft.PowerShell.Commands.Utility/resources/AddTypeStrings.resx | Protect Add-Type and ConstrainedLanguage. |
Review effort: Balanced
Aditya Patwardhan (adityapatwardhan)
approved these changes
Nov 5, 2026
Dongbo Wang (daxian-dbw)
merged commit Nov 5, 2026
cbf293e
into
PowerShell:master
42 of 43 checks passed
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.
PR Summary
Add
StrContainsfor language modes used in resource strings.The language-mode words need to be locked so that they can be preserved in localized resources.