Chinese Translation

added Chinese Translation for installer https://github.com/SpotX-CLI/SpotX-Win/issues/189

Co-Authored-By: lumineyuri <110418934+lumineyuri@users.noreply.github.com>
This commit is contained in:
amd64fox
2022-10-24 17:29:13 +03:00
parent 49ac47edd4
commit b7f18e25d5
2 changed files with 77 additions and 2 deletions
+10 -2
View File
@@ -107,7 +107,7 @@ function Format-LanguageCode {
begin {
$supportLanguages = @(
'en', 'ru', 'it', 'tr', 'ka', 'pl', 'es', 'fr', 'hi', 'pt', 'id', 'vi', 'ro', 'de', 'hu'
'en', 'ru', 'it', 'tr', 'ka', 'pl', 'es', 'fr', 'hi', 'pt', 'id', 'vi', 'ro', 'de', 'hu', 'zh'
)
}
@@ -174,6 +174,10 @@ function Format-LanguageCode {
$returnCode = 'hu'
break
}
'^zh' {
$returnCode = 'zh'
break
}
Default {
$returnCode = $PSUICulture.Remove(2)
break
@@ -272,6 +276,10 @@ function Set-ScriptLanguageStrings($LanguageCode) {
$langStrings = CallLang -clg "hu"
break
}
'zh' {
$langStrings = CallLang -clg "zh"
break
}
Default {
# Default to English if unable to find a match.
$langStrings = CallLang -clg "en"
@@ -292,7 +300,7 @@ $lang = Set-ScriptLanguageStrings -LanguageCode $langCode
# Set variable 'ru'.
if ($langCode -eq 'ru') { $ru = $true }
# Set variable 'add translation line'.
if ($langCode -match '^(it|tr|ka|pl|es|fr|hi|pt|id|vi|ro|de|hu)') { $line = $true }
if ($langCode -match '^(it|tr|ka|pl|es|fr|hi|pt|id|vi|ro|de|hu|zh)') { $line = $true }
# Automatic length of stars
$au = ($lang).Author.Length + ($lang).Author2.Length