Siva
Siva

Reputation: 1411

How to get current system locale name?

My default operating system is English. I have changed system locale name to Japanese. How can I get the current system locale name(Japanese). Please find the screenshot for your reference.

enter image description here

I had tried the below api's to get the system locale, but none of them are worked for me. For instance as per above scenario I must get system locale name as Japanese.

-GetLocaleInfo
-GetUserDefaultLCID
-GetSystemDefaultLangID

Upvotes: 0

Views: 1657

Answers (1)

IInspectable
IInspectable

Reputation: 51345

Japanese is not a locale name. It's the localized language name. The respective locale name would be ja-JP for Japanese (Japan).

To retrieve the current user's localized language name, call GetLocaleInfoEx specifying an LCType parameter of LOCALE_SLOCALIZEDLANGUAGENAME.

Upvotes: 5

Related Questions