winapi - How to get current operating system language? -
i newbie mfc, , got struck on how current operating system language (ex: if english operating system must english , locale can different. english os locale can japanese vice versa).
current locale getting through getsystemdefaultlangid
, thing left need current operating system language.
can kindly me resolve issue.
this came before. maybe need getuserdefaultuilanguage
?
user interface language management
int wmain(int argc, _tchar* argv[]) { wcout << "getuserdefaultuilanguage: " << getuserdefaultuilanguage() << endl; wcout << "getsystemdefaultuilanguage: " << getsystemdefaultuilanguage() << endl; wcout << endl; wcout << "getuserdefaultlangid: " << getuserdefaultlangid() << endl; wcout << "getsystemdefaultlangid: " << getsystemdefaultlangid() << endl; wcout << endl; wcout << "getuserdefaultlcid: " << getuserdefaultlcid() << endl; wcout << "getsystemdefaultlcid: " << getsystemdefaultlcid() << endl; wcout << endl; wchar_t buf[100]; lcid lcid = getuserdefaultlcid(); cout << "getuserdefaultlcid: " << endl; if (getlocaleinfo(lcid, locale_ilanguage, buf, 100)) wcout << buf << endl; if (getlocaleinfo(lcid, locale_senglanguage, buf, 100)) wcout << buf << endl; if (getlocaleinfo(lcid, locale_siso639langname, buf, 100)) wcout << buf << endl << endl; system("pause"); return 0; }
Comments
Post a Comment