Skip to content

Update LocProject.json to list each English resource file directly - #27751

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
daxian-dbw:locproj
Jul 31, 2026
Merged

Update LocProject.json to list each English resource file directly#27751
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
daxian-dbw:locproj

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

PR Summary

Update LocProject.json to list each English resource file directly.

I was using wild-card pattern resources\\*.resx initially. 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 under resources\\, 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.json file.
Tests are also added to validate the content in LocProject.json file is in sync with the actual files in the repo.

PR Checklist

@daxian-dbw
Dongbo Wang (daxian-dbw) requested a review from a team as a code owner July 31, 2026 20:31
Copilot AI review requested due to automatic review settings July 31, 2026 20:31
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@daxian-dbw Dongbo Wang (daxian-dbw) added CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log Backport-7.6.x-Consider labels Jul 31, 2026

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 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\\*.resx wildcard patterns in LocProject.json with explicit per-file LocItems.
  • Updated LocProject.json entries to use LangIDOnPathAndName and a directory OutputPath.
  • Added LocProject.Tests.ps1 to validate LocProject.json entries 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 resources directory under src (Get-ChildItem 'resources' ...), but the repo's .resx files live under src/<project>/resources (there is no src/resources). This makes the test return an empty list (or error) and the count comparison invalid; it also needs to avoid counting localized resources/<culture>/*.resx files.
            $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

Comment thread test/powershell/engine/ResourceValidation/LocProject.Tests.ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.6.x-Done CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants