Update LocProject.json to list each English resource file directly - #27751
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.
Pull request overview
This PR updates the localization configuration to avoid wildcard-based .resx discovery (which can unintentionally pick up localized resources) by explicitly listing each English resource file in Localize/LocProject.json, and adds Pester tests to keep that list in sync with the repository’s actual English .resx files.
Changes:
- Replaced
resources\\*.resxwildcard patterns inLocProject.jsonwith explicit per-fileLocItems. - Updated
LocProject.jsonentries to useLangIDOnPathAndNameand a directoryOutputPath. - Added
LocProject.Tests.ps1to validateLocProject.jsonentries exist and match the expected resource inventory.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
Localize/LocProject.json |
Lists each English .resx explicitly to prevent localized .resx files being treated as source resources. |
test/powershell/engine/ResourceValidation/LocProject.Tests.ps1 |
Adds CI validation to ensure LocProject.json stays aligned with actual English .resx files in the repo. |
Suppressed comments (1)
test/powershell/engine/ResourceValidation/LocProject.Tests.ps1:44
- The resource-count test enumerates a
resourcesdirectory undersrc(Get-ChildItem 'resources' ...), but the repo's.resxfiles live undersrc/<project>/resources(there is nosrc/resources). This makes the test return an empty list (or error) and the count comparison invalid; it also needs to avoid counting localizedresources/<culture>/*.resxfiles.
$resDirs = Get-ChildItem 'resources' -Recurse -Directory | ForEach-Object FullName
$totalResourceCount = 0
foreach ($resDir in $resDirs) {
$count = Get-ChildItem -Path "$resDir/*.resx" | Measure-Object | ForEach-Object Count
$totalResourceCount += $count
}
$project.LocItems.Count | Should -Be $totalResourceCount
Aditya Patwardhan (adityapatwardhan)
approved these changes
Jul 31, 2026
9 tasks
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
Update LocProject.json to list each English resource file directly.
I was using wild-card pattern
resources\\*.resxinitially. The internal doc says "Discovering files recursively is not supported", however, The PR #27749 from localization build indicates it does search recursively into language folders underresources\\, which caused all localized resources to be treated as default English resources incorrectly.This PR fixes it by listing all default English resource files directly in
LocProject.jsonfile.Tests are also added to validate the content in
LocProject.jsonfile is in sync with the actual files in the repo.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header