Wednesday, April 24, 2024
HomeGolangWhy does os.LookupEnv("LANG") decide the flawed language? - Getting Assist

Why does os.LookupEnv(“LANG”) decide the flawed language? – Getting Assist


	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

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments