Problem applies to: gnumeric versions 1.4.1 1.4.2 1.4.3 on amd64. gnumeric ignores locale settings. gnumeric is showing in english even with LANG=pt_BR LC_ALL=pt_BR LC_MESSAGES=pt_BR inserting some printfs in strategic places seems to indicate that LC_ALL and LC_MESSAGES get changed to "C" at some point on the code. However, searching the source for "setlocale" shows that, whenever a call to setlocale occurs to change a locale for a category, a further call restores the old category. I inserted a 'setlocale(LC_ALL,"")' and 'setlocale(LC_MESSAGES,"")' in the main() function of the application. Immediately after, I print the current locale for these categories, which shows "pt_BR". Again, when UI is created, the locale is "C". Maybe this a problem with glibc? or libintl? This problem only occurs at my amd64 machine. My x86 works correctly. This is a showstopper bug for me because I intend to deply gnumeric as the spreadsheet application on brazillian company which is migrating to Linux. I haven't seem any related bug reports here or in the gnumeric site. Please enter in contact. I will be very happy to help debugging this with some help from someone more knowledgeable in this application. Thanks, Jo
Problem applies to: gnumeric versions 1.4.1 1.4.2 1.4.3 on amd64. gnumeric ignores locale settings. gnumeric is showing in english even with LANG=pt_BR LC_ALL=pt_BR LC_MESSAGES=pt_BR inserting some printfs in strategic places seems to indicate that LC_ALL and LC_MESSAGES get changed to "C" at some point on the code. However, searching the source for "setlocale" shows that, whenever a call to setlocale occurs to change a locale for a category, a further call restores the old category. I inserted a 'setlocale(LC_ALL,"")' and 'setlocale(LC_MESSAGES,"")' in the main() function of the application. Immediately after, I print the current locale for these categories, which shows "pt_BR". Again, when UI is created, the locale is "C". Maybe this a problem with glibc? or libintl? This problem only occurs at my amd64 machine. My x86 works correctly. This is a showstopper bug for me because I intend to deply gnumeric as the spreadsheet application on brazillian company which is migrating to Linux. I haven't seem any related bug reports here or in the gnumeric site. Please enter in contact. I will be very happy to help debugging this with some help from someone more knowledgeable in this application. Thanks, João Rafael Moraes Nicola joaoraf@gmail.com
Created attachment 62524 [details, diff] This fixes it! It seems that there is some code in go-math.c that assumes that the string returned by the setlocale(..,NULL) function call is non-static. However, the man page for setlocale says that the string MAY be static. This patch removes that assumption by calling strdup to duplicate the string. I am not sure, though, if I should free the string after the next call to setlocale, because I don't know whether the setlocale function makes a copy or not of its parameter. If it does, this should not be a serious leakage since the code gets executed only once. My gnumeric is now OK :-)
same problem here with gnumeric 1.4.3 on x86 but have not tried to apply the patch yet. Output of locale: LANG=de_DE@euro LC_CTYPE="de_DE@euro" LC_NUMERIC="de_DE@euro" LC_TIME="de_DE@euro" LC_COLLATE="de_DE@euro" LC_MONETARY="de_DE@euro" LC_MESSAGES="de_DE@euro" LC_PAPER="de_DE@euro" LC_NAME="de_DE@euro" LC_ADDRESS="de_DE@euro" LC_TELEPHONE="de_DE@euro" LC_MEASUREMENT="de_DE@euro" LC_IDENTIFICATION="de_DE@euro" LC_ALL=de_DE@euro
maybe this bug should be reassigned to gnome@gentoo.org ?
This patch worked for me (z4), too. Please add it to the ebuild.
reassigning to gnome@g.o as it seems not to be amd64-specific
Can you post an upstream bug at http://bugs.gentoo.org under the gnumeric component to get the attention and advice of the maintainer.
This should be fixed with gnumeric-1.6.1 and new versions of libgsf/goffice.