Simplified locale support

pull/25/head
Romain 2022-03-08 09:45:36 +01:00
parent 2efadb7745
commit a2d1adf8b3
1 changed files with 4 additions and 4 deletions

View File

@ -32,16 +32,16 @@ function Init {
#Default english
$DefaultLocale = "$WorkingDir\locale\en.xml"
#Get OS locale
$Locale = (Get-Culture).Parent.Name
$Locale = (Get-Culture).Parent
#Test if OS locale config file exists
$LocaleFile = "$WorkingDir\locale\$locale.xml"
$LocaleFile = "$WorkingDir\locale\$($locale.Name).xml"
if(Test-Path $LocaleFile){
[xml]$Script:NotifLocale = Get-Content $LocaleFile -Encoding UTF8 -ErrorAction SilentlyContinue
$LocaleNotif = "Notification Langugage : $($locale.Name)"
$LocaleNotif = "Notification Langugage : $($locale.DisplayName)"
}
else{
[xml]$Script:NotifLocale = Get-Content $DefaultLocale -Encoding UTF8 -ErrorAction SilentlyContinue
$LocaleNotif = "Notification Langugage : en-US"
$LocaleNotif = "Notification Langugage : English"
}
Write-Log $LocaleNotif "Cyan"
}