mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
fix: split the apple locale on the region for LANG
We use AppleLocale to get the desired language when running on macos. Unfortunately, if a region is set, the locale is not equivalent to the LANG environment variable. It appends an extra region field that we did not previously filter out. This change ensures that it will be filtered out when present.
This commit is contained in:
parent
fc0b82836c
commit
3135a3cd76
@ -393,7 +393,9 @@ func determineLang() string {
|
||||
log.Printf("error executing 'defaults read -g AppleLocale': %v\n", err)
|
||||
return ""
|
||||
}
|
||||
return strings.TrimSpace(string(out)) + ".UTF-8"
|
||||
strOut := string(out)
|
||||
truncOut := strings.Split(strOut, "@")[0]
|
||||
return strings.TrimSpace(truncOut) + ".UTF-8"
|
||||
} else {
|
||||
// this is specifically to get the wavesrv LANG so waveshell
|
||||
// on a remote uses the same LANG
|
||||
|
Loading…
Reference in New Issue
Block a user