detect os language from c#

后端 未结 7 1298
北荒
北荒 2020-12-06 01:32

Is there a way to detect the Language of the OS from within a c# class?

7条回答
  •  萌比男神i
    2020-12-06 01:40

    All of the answers above seem to only get you the OS installed culture (at best). I ran into an issue where I needed the actual display language being used in Windows. i.e. the user installed the default en-US Windows install, but then added a language pack for German (de-DE) and set that as their display language.

    To get that, I used System.Windows.Input.InputLanguageManager.Current.CurrentInputLanguage

提交回复
热议问题