I need to convert some 2-letter (neutral) identifiers (like en
for English) so something more friendly for user, like English.
Is there an Api that does that using Win32 ? So far I have found only LCID family of functions that doesn't help.
I need to convert some 2-letter (neutral) identifiers (like en
for English) so something more friendly for user, like English.
Is there an Api that does that using Win32 ? So far I have found only LCID family of functions that doesn't help.
You're looking for IsValidLocaleName
, GetLocaleInfoEx
and LOCALE_SLANGUAGE
/ LOCALE_SLOCALIZEDLANGUAGENAME
/ LOCALE_SENGLISHLANGUAGENAME
, which are defined in WinNls.h
as:
#define LOCALE_SLOCALIZEDDISPLAYNAME 0x00000002 // localized name of locale, eg "German (Germany)" in UI language
#if (WINVER >= _WIN32_WINNT_VISTA)
#define LOCALE_SLOCALIZEDLANGUAGENAME 0x0000006f // Language Display Name for a language, eg "German" in UI language
#endif //(WINVER >= _WIN32_WINNT_VISTA)
#define LOCALE_SENGLISHLANGUAGENAME 0x00001001 // English name of language, eg "German"
#define LOCALE_SNATIVELANGUAGENAME 0x00000004 // native name of language, eg "Deutsch"
(depending on OS version and your requirements).
Note: XP only uses LCID
's
here is a table : http://www.lingoes.net/en/translator/langcode.htm copy paste it, put it into a map and there you go.