GNOME Bugzilla – Bug 450353
French locale fr instead of fr_FR on Windows
Last modified: 2018-06-29 21:40:08 UTC
Please describe the problem: Hello, I use Gnucash-2.1.4 with Windows 2000 Professionnal and Service Pack 4. Windows Language Parameter : French(France). When I create a new file with a new account, Gnucash don't load french translated account strings.The hierarchy account is in english. Category list is in english.Category description is in english. I found a workaround to have the hierachy account and category list in french. I copy the directory C:\Program Files\gnucash\share\gnucash\accounts\fr_FR to C:\Program Files\gnucash\share\gnucash\accounts\fr and after this copy , Gnucash load correctly the french translated account strings. Thanks to correct this problem for gnucash 2.1.5 or gnucash-2.2.0. Yannick LE NY Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Could you please tell us your effective locale by running the attached program?
Created attachment 90557 [details] Print the result of g_win32_getlocale()
Print the result of g_win32_getlocale() C:\>lang Locale: fr
Well, we have fr_CA, fr_CH, and fr_FR account templates. Which one should we choose if the locale only says "fr"...? :-)
Hm. Reading http://developer.gnome.org/doc/API/2.0/glib/glib-Windows-Compatibility-Functions.html#id2879870 I think there is a bug in GLib. CC'ing tml, he may know better.
The exact strings returned by from g_win32_getlocale() have not been that strictly defined. Anyway, in GLib 2.12.8 and later g_win32_getlocale() will always return a string of the form "<iso639>_<iso3166>", where <iso639> is the language code and <iso3166> the country code, possibly suffixed with a script like "@Latn". Presumably, for French, based on what locales EnumSystemLocales() gives on XP, the returned string will then always be one of: fr-FR fr-BE fr-CA fr-CH fr-LU fr-MC. On Vista probably even more possibilities. The corresponding ChangeLog entry: 2007-01-15 Tor Lillqvist <tml@novell.com> * glib/gwin32.c (g_win32_getlocale): Simplify greatly. Instead of hardcoding a large switch statement, just ask Windows for the ISO639 and ISO3166 codes. Tack on @Latn or @Cyrl for those languages which can alternatively be written in Latin or Cyrillic. Fixes #395419. Try the test program with a more recent GLib, 2.12.8 or later.
Oops, replace dashes with underscores above.
That is strange, because we ship GnuCash with GLib 2.12.11. Yannick, please make sure you locate lang.exe in the bin subdirectory of your gnucash installation and that libglib-2.0-0.dll has a version string of 2.12.11 (I think the Windows Explorer can show that, depends.exe definitely does it)
It could also be that Yannick has set one of the environment variables LC_ALL, LC_MESSAGES or LANG to "fr" (by mistake, or maybe some unrelated software has done it). That will override.
Hello, I have more information for you. I use Gnucash-2.1.4 with Windows 2000 Professionnal and Service Pack 4. Windows Language Parameter : French(France). I found on my harddisk : C:\Program Files\Fichiers communs\GTK\2.0\bin\libglib-2.0-0.dll version : 2.12.11.0 C:\Program Files\gnucash\bin\libglib-2.0-0.dll version : 2.12.11.0 C:\Program Files\Miranda-IM\libglib-2.0-0.dll version : 2.6.6.0 C:\Program Files\Grisbi\libglib-2.0-0.dll version : 2.6.6.0 I found in my windows user variables : LANG=fr I remove all files with libglib-2.0-0.dll (version : 2.6.6.0) and remove my user variables LANG= fr and I reboot my Personnal Computer. I do : C:\>lang Locale: fr But when I start gnucash , the gnucash accounts are in english. After this test, I stop Gnucash. I add LANG=fr_FR in my windows user variables. I do : C:\>lang Locale: fr But when I start now gnucash , the gnucash accounts are in french. Do you need to add LANG=fr_FR in the windows user variables when the gnucash's windows installer is installing gnucash on the user's PC.
You shouldn't have to set any environment variable. Just making sure you use GLib 2.12.8 or newer should be enough. Are you sure that you started a fresh command prompt after changing the environment variables? Maybe you by mistake did the test in a shell where the old LANG=fr was still in force? Otherwise I don't understand what is going on...
I do a new test by default with Windows 2000 Professionnal and Service Pack 4 and Windows Language Parameter : French(France). I reboot my PC. I have no lang environment variable in my user environment variables. I do it in a shell window with cmd command: C:\>lang Locale: fr Next, I add LANG=fr_FR in my windows user variables. I do it in a NEW shell window with cmd command: C:\>lang Locale: fr_FR
Hello, I do a new test AT WORK with an other PC with Windows 2000 Professionnal and Service Pack 4 and Windows Language Parameter : French(France). I have no problem, all are in french except if I add LANG=fr in my windows user variables. I don' know what is the problem with gnucash with my PC at home. Yannick
Out of curiosity: There is no _system_ variable LANG, LANGUAGE or LC_something set, right? :-)
Yes, there is no _system_ variable LANG, LANGUAGE or LC_something set on my PC at home or at work now.
Yannick, GnuCash 2.2.5 ships with GLib 2.14.6, so is this still an issue?
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=450353. Please update any external references or bookmarks.