Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4080685 By: tml1024
An alternative to lookup tables is to call EnumSystemLocales() and for each locale call GetLocaleInfo(LOCALE_SISO639LANGNAME) and GetLocaleInfo(LOCALE_SISO3166CTRYNAME) and compare those to the environment variable values until you get a match. Then you call GetLocaleInfo(LOCALE_SENGLANGUAGE) and GetLocaleInfo(LOCALE_SENGCOUNTRY), join these two strings with an underscore, and call setlocale() on the result. Some additional complexity is caused in for instance the case of the former Yugoslavia, where language and country codes change too fast for the Win32 API to keep up (for instance, the API has LANG_SERBIAN == LANG_CROATIAN which probably is a considered a quite rude point of view nowadays). See the functions enum_locale_proc() and do_pre_parse_initialization() in http://svn.gnome.org/svn/gtk+/trunk/gtk/gtkmain.c for example code (LGPL licensed). --tml ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=74807 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ GnuWin32-Users mailing list GnuWin32-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnuwin32-users