From 2efadb774587ae817d78a003b3a5cab85e05bc2a Mon Sep 17 00:00:00 2001 From: Romain <96626929+Romanitho@users.noreply.github.com> Date: Tue, 8 Mar 2022 09:32:10 +0100 Subject: [PATCH] Simplified locale support --- Winget-AutoUpdate/winget-upgrade.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Winget-AutoUpdate/winget-upgrade.ps1 b/Winget-AutoUpdate/winget-upgrade.ps1 index 23b7fcb..8f5ce51 100644 --- a/Winget-AutoUpdate/winget-upgrade.ps1 +++ b/Winget-AutoUpdate/winget-upgrade.ps1 @@ -9,7 +9,7 @@ function Init { $Log | Write-host try{ #Logs initialisation - [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 + [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $LogPath = "$WorkingDir\logs" if (!(Test-Path $LogPath)){ New-Item -ItemType Directory -Force -Path $LogPath @@ -29,12 +29,12 @@ function Init { } #Get locale file for Notification - #Default en-US - $DefaultLocale = "$WorkingDir\locale\en-US.xml" + #Default english + $DefaultLocale = "$WorkingDir\locale\en.xml" #Get OS locale - $Locale = Get-WinSystemLocale + $Locale = (Get-Culture).Parent.Name #Test if OS locale config file exists - $LocaleFile = "$WorkingDir\locale\$($locale.Name).xml" + $LocaleFile = "$WorkingDir\locale\$locale.xml" if(Test-Path $LocaleFile){ [xml]$Script:NotifLocale = Get-Content $LocaleFile -Encoding UTF8 -ErrorAction SilentlyContinue $LocaleNotif = "Notification Langugage : $($locale.Name)"