Get current language in CultureInfo

后端 未结 6 1185
说谎
说谎 2020-12-05 17:20

How to identify the operating system\'s language using CultureInfo? E.g. if the language in Windows is set to French, I need to identify French and load the

6条回答
  •  有刺的猬
    2020-12-05 17:46

    I tried {CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;} but it didn`t work for me, since my UI culture was different from my number/currency culture. So I suggest you to use:

    CultureInfo currentCulture = Thread.CurrentThread.CurrentUICulture;
    

    This will give you the culture your UI is (texts on windows, message boxes, etc).

提交回复
热议问题