s, _ := os.LookupEnv("LANG")
fmt.Println(s)
This offers en_US.UTF-8 which is way from my laptop language setting. How can I get correct laptop default language?
For Posix, a conference appears to be to make use of any of those atmosphere variables, so possibly test for another ones:
- LANGUAGE
- LC_ALL
- LC_MESSAGES, LC_NUMERIC, LC_TIME, LC_COLLATE, and others
- LANG
(Supply)
On Home windows, I see LC_CTYPE=“en_US.UTF-8”, however there’s additionally a Home windows API operate to get that info: GetSystemDefaultUILanguage. I’m undecided if there’s an equal for different OSes