From 7d83aaa5e011fa6775655f9d464dae9c5c221453 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 Aug 2025 15:28:05 +0000 Subject: [PATCH 1/2] Fix failing Pester tests - LocalizationParser default culture and psake configuration Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com> --- CHANGELOG.md | 2 +- psake.ps1 | 6 ++++-- resources/LocalizationParser.ps1 | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc174ea..b5c8f09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. -## [Unreleased] +## [0.2.0] ### Added - Windows PowerShell fallback support for better compatibility diff --git a/psake.ps1 b/psake.ps1 index ca76262..2077739 100644 --- a/psake.ps1 +++ b/psake.ps1 @@ -7,9 +7,10 @@ Properties { $script:outDir = 'out' $script:scriptDir = $PSScriptRoot - $script:PesterConfiguration = [PesterConfiguration]@{} + $script:PesterConfiguration = New-PesterConfiguration $script:PesterConfiguration.Output.CIFormat = 'Auto' $script:PesterConfiguration.Run.Path = ".\tests\" + $script:PesterConfiguration.Run.PassThru = $true } Task Default -Depends Test @@ -77,7 +78,8 @@ Task VscodeTest -Depends InstallDependencies { Task Pester { Write-Host '🧪 Running Pester tests...' try { - $results = Invoke-Pester -Configuration $script:PesterConfiguration -PassThru + Import-Module Pester + $results = Invoke-Pester -Configuration $script:PesterConfiguration if ($results.FailedCount -gt 0) { Write-Error '❌ Pester tests failed. Please fix the issues before packaging.' exit 1 diff --git a/resources/LocalizationParser.ps1 b/resources/LocalizationParser.ps1 index 150a83f..ba0ccca 100644 --- a/resources/LocalizationParser.ps1 +++ b/resources/LocalizationParser.ps1 @@ -136,6 +136,9 @@ if (Test-Path $file) { } if ($null -ne $UICulture -and -not [String]::IsNullOrEmpty($UICulture.Name)) { $splat['UICulture'] = $UICulture.Name + } else { + # Default to en-US when no UICulture is specified + $splat['UICulture'] = 'en-US' } # Override the base directory if its set $splat['BaseDirectory'] = $parentDirectory From f75c4809b8628fee386a583b9a360d67d907cbc8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 12 Aug 2025 23:00:54 +0000 Subject: [PATCH 2/2] Revert version change in CHANGELOG.md to keep it in Unreleased section Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com> --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5c8f09..7c6b1ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. -## [0.2.0] +## [Unreleased] ### Added - Windows PowerShell fallback support for better compatibility @@ -28,6 +28,14 @@ to structure this file. - Smart log filtering that respects the configured log level - Debug messages are now filtered out by default, providing cleaner output +### Fixed +- LocalizationParser.ps1 now defaults to en-US culture when UICulture parameter is not provided + - Fixes Import-LocalizedData failures in environments with invariant culture + - Ensures localization files can be found in culture-specific subdirectories +- Updated Pester configuration syntax in psake.ps1 for compatibility with Pester 5.x + - Replaced deprecated [PesterConfiguration]@{} with New-PesterConfiguration + - Fixed PassThru parameter usage for modern Pester API + ## [0.1.0] Initial Release - Foundational script `LocalizationParser` looks for `psm1` that container