[Please CC me on the responses, as I'm not subscribed to this list.] > From: lrn1...@gmail.com > Date: Mon, 12 Mar 2018 23:23:21 +0300 > > > const char * > > gl_locale_name (int category, const char *categoryname) > > { > > const char *retval; > > > > retval = gl_locale_name_thread (category, categoryname); > > if (retval != NULL) > > return retval; > > > > retval = gl_locale_name_posix (category, categoryname); > > if (retval != NULL) > > return retval; > > > > return gl_locale_name_default (); > > } > > > > GetThreadLocale is called from gl_locale_name_default, which is the > > last resort. Before that, the function calls gl_locale_name_thread, > > which on MS-Windows calls setlocale, as you wanted. > > > > So I'm not sure what problem did you have and why. Or maybe I'm > > missing something. > > I've re-traced this, here's how it works: > > libintl_dcigettext (domainname=0x45e3718 "gedit", domainname@entry=0x0, > msgid1=msgid1@entry=0x6887f8af <__FUNCTION__.74302+47> "", > msgid2=msgid2@entry=0x0, plural=plural@entry=0, n=n@entry=0, > category=category@entry=1729) > at gettext-0.19.7/gettext-tools/../gettext-runtime/intl/dcigettext.c:667 > > guess_category_value (categoryname=0x61ed714d "LC_MESSAGES", category=1729) > at gettext-0.19.7/gettext-tools/../gettext-runtime/intl/dcigettext.c:1561 > > _nl_locale_name_posix (category=1729, categoryname=0x61ed714d "LC_MESSAGES") > at gettext-0.19.7/gettext-tools/../gettext-runtime/intl/localename.c:2815
This shows that guess_category_value calls gl_locale_name_posix directly, instead of calling gl_locale_name. So the question now becomes why does gettext do that, and whether it should do something different at least on MS-Windows. Also note that LC_MESSAGES is not supported by the Windows setlocale, so either gettext should use some other category, or it will have to invent stuff out of thin air, something I don't recommend. > My Windows installation is in English (i.e. this is the language of the > installer and the UI language for all applications and system software), but > i > have Russian regional settings (time, date, weekday names, currency, number > formatting). Because of this any program using gettext is in Russian, unless > i > deliberately set LANG or LC_*. Which in general sounds quite reasonable to me, btw, given the description of your setup. And what does setlocale(LC_ALL,NULL) return on that system?