File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1701,26 +1701,25 @@ catch {
17011701$window.ShowDialog () | Out-Null
17021702}
17031703function System-Default {
1704- try {
1705- $dc = $itt.database.locales.Controls .$shortCulture
1706- if (-not $dc -or [string ]::IsNullOrWhiteSpace($dc )) {
1707- Set-Statusbar - Text " Default System language is not supported yet, Fallback to English"
1708- $dc = $itt.database.locales.Controls.en
1709- }
1710- $itt [" window" ].DataContext = $dc
1711- Set-ItemProperty - Path $itt.registryPath - Name " locales" - Value " default" - Force
1704+ $itt.Language = $itt.database.locales.Controls
1705+ if ($itt.Language.PSObject.Properties.Name -contains $shortCulture ) {
1706+ $itt [" window" ].DataContext = $itt.database.locales.Controls .$shortCulture
1707+ $itt.Language = $shortCulture
17121708}
1713- catch {
1714- Write-Host " An error occurred: $_ "
1709+ else
1710+ {
1711+ Set-Statusbar - Text " System language is not supported yet, Fallback to English"
1712+ $itt.Language = " en"
17151713}
1714+ Set-ItemProperty - Path $itt.registryPath - Name " locales" - Value " default" - Force
17161715}
17171716function Set-Language {
17181717param ([string ]$lang )
17191718if ($lang -eq " default" ) { System- Default }
17201719else {
1721- $itt.Language = $lang
17221720$itt [" window" ].DataContext = $itt.database.locales.Controls .$ ($itt.Language )
17231721Set-ItemProperty - Path $itt.registryPath - Name " locales" - Value $lang - Force
1722+ $itt.Language = $lang
17241723}
17251724}
17261725function SwitchToSystem {
You can’t perform that action at this time.
0 commit comments