update docs with supported list, fix language check

This commit is contained in:
RomikB
2025-04-07 10:33:11 +02:00
parent fb42168fbb
commit 301b4cc067
2 changed files with 9 additions and 5 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
#### `HKCU\Software\AmneziaWG\Language`
When this key is set, the UI will try to use the specified language as display language.
Supported languages: "ca", "cs", "de", "en", "es_ES", "et", "fa", "fi", "fr", "id", "it", "ja", "ko", "nl", "pa_IN", "pl", "pt_BR", "ro", "ru", "si_LK", "sk", "sl", "sv_SE", "tr", "uk", "vi", "zh_CN", "zh_TW".
```
> reg add HKCU\Software\AmneziaWG /v LimitedOperatorUI /t REG_SZ /d "en" /f
> reg add HKCU\Software\AmneziaWG /v Language /t REG_SZ /d "en" /f
```
+7 -4
View File
@@ -42,10 +42,13 @@ func prn() *message.Printer {
func lang() (tag language.Tag) {
keyString, res := services.UserKeyString(LanguageUserKey)
if res {
keyTag := message.MatchLanguage(keyString)
if keyTag.String() == keyString {
tag = keyTag
return
normalizedKeyTag, err := language.Parse(keyString)
if err == nil {
keyTag := message.MatchLanguage(keyString)
if normalizedKeyTag == keyTag {
tag = keyTag
return
}
}
}
tag = language.English