A good Windows client, of course, to do internationalization.
Let's start with a few functions today to get the language of the Windows operating system.
getsystemdefaultlcid function
This function is simple and has no parameters, only the return value:
Returns the locale identifier for the system locale
GetSystemDefaultUILanguage
Retrieves theLanguage identifier for the systemDefault UI language of theOperatingsystem, also known as the "Install language" on windows vista and later . for more information , see User interface language management .
GetUserDefaultUILanguage
Returns the language identifier for the user UI language for the current user. If the current user have not set a language, GetUserDefaultUILanguage returns the preferred language set for the system. If there is no preferred language set for the system and then the system default UI language (also known as "Install language ") is returned. For more information on the user UI language, see User Interface language Management.
Prototype:
LANGID GetUserDefaultUILanguage(void);
#include <iostream> #include <windows.h> #pragma Comment (lib, "Kernel32.lib") int Main () {auto< /span> iter = GetUserDefaultUILanguage (); auto iter2 = GetSystemDefaultUILanguage (); std :: cout << iter << std :: Endl; std :: cout << iter2 << std :: Endl; return 0 ;} //output: //2052 //2052
What is the return value LangID:
Arabic
1025
Arabic
Basque
1069
Ansi
Catalan
1027
Ansi
Chinese (Simplified)
2052
GB2312
Chinese (Traditional)
1028
Chinese-big 5
Czech
1029
Eastern European
Danish
1030
Ansi
Dutch
1043
Ansi
中文版 (states)
1033
Ansi
Finnish
1035
Ansi
French
1036
Ansi
German
1031
Ansi
Greek
1032
Greek
Hebrew
1037
Hebrew
Hungarian
1038
Eastern European
Italian
1040
Ansi
Japanese
1041
Shift-jis
Korean
1042
Johab
Norwegian
1044
Ansi
Polish
1045
Eastern European
Portuguese
2070
Ansi
Portuguese (Brazil)
1046
Ansi
Russian
1049
Russian
Slovakian
1051
Eastern European
Slovenian
1060
Eastern European
Spanish
3082
Ansi
Swedish
1053
Ansi
Turkish
1055
Turkish
Also, if this error occurs with VS:
Error LNK2001: unresolved external symbol [email protected]
Linker-Systems-subsystems-Select workbench
Windows Client Development-Preparing for internationalization