diff --git a/.github/actions/infrastructure/path-filters/action.yml b/.github/actions/infrastructure/path-filters/action.yml index b50384f69..18e78e9a2 100644 --- a/.github/actions/infrastructure/path-filters/action.yml +++ b/.github/actions/infrastructure/path-filters/action.yml @@ -112,6 +112,9 @@ runs: const globalConfigChanged = files.some(file => file === '.globalconfig' || file === 'nuget.config' || file === 'global.json'); console.log(`✓ Global config changed: ${globalConfigChanged}`); + const localizationConfigChanged = files.some(file => file === 'Localize/LocProject.json'); + console.log(`✓ Localization config changed: ${localizationConfigChanged}`); + const packagingChanged = files.some(file => file === '.github/workflows/windows-ci.yml' || file === '.github/workflows/linux-ci.yml' || @@ -128,7 +131,7 @@ runs: toolsCiPsm1Changed; console.log(`→ Packaging changed: ${packagingChanged}`); - const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged || globalConfigChanged; + const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged || globalConfigChanged || localizationConfigChanged; console.log(`→ Source (composite): ${source}`); core.endGroup(); diff --git a/test/powershell/engine/ResourceValidation/LocProject.Tests.ps1 b/test/powershell/engine/ResourceValidation/LocProject.Tests.ps1 index f8e77c0fb..4f348fa2d 100644 --- a/test/powershell/engine/ResourceValidation/LocProject.Tests.ps1 +++ b/test/powershell/engine/ResourceValidation/LocProject.Tests.ps1 @@ -29,8 +29,18 @@ Describe "LocProject.json file validation" -Tags "CI" { $realSourceFile = Join-Path $repoRoot $sourceFile Test-Path -Path $realSourceFile | Should -BeTrue - $_.OutputPath | Should -BeExactly "$parentDir\" - $_.CopyOption | Should -BeExactly 'LangIDOnPathAndName' + + if ($sourceFile -like '*.resx') { + $_.OutputPath | Should -BeExactly "$parentDir\" + $_.CopyOption | Should -BeExactly 'LangIDOnPathAndName' + } + elseif ($sourceFile -like '*.xml') { + $_.OutputPath + "en-US" | Should -BeExactly $parentDir + $_.CopyOption | Should -BeExactly 'LangIDOnPath' + } + else { + throw "Unexpected source file type: $sourceFile" + } } } @@ -38,6 +48,21 @@ Describe "LocProject.json file validation" -Tags "CI" { $srcDir = Join-Path $repoRoot 'src' $project = $locProject.Projects[0] + $resxLocItemCount = 0 + $xmlLocItemCount = 0 + + foreach ($item in $project.LocItems) { + if ($item.SourceFile -like '*.resx') { + $resxLocItemCount++ + } + elseif ($item.SourceFile -like '*.xml') { + $xmlLocItemCount++ + } + else { + throw "Unexpected source file type: $($item.SourceFile)" + } + } + try { Push-Location -Path $srcDir $resDirs = Get-ChildItem 'resources' -Recurse -Directory | ForEach-Object FullName @@ -48,7 +73,8 @@ Describe "LocProject.json file validation" -Tags "CI" { $totalResourceCount += $count } - $project.LocItems.Count | Should -Be $totalResourceCount + $resxLocItemCount | Should -Be $totalResourceCount + $xmlLocItemCount | Should -Be 1 } finally { Pop-Location