After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 611415 - incomplete locale determination
incomplete locale determination
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-02-28 17:16 UTC by Andreas J. Guelzow
Modified: 2010-03-02 18:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Tentative patch (2.23 KB, patch)
2010-03-01 19:40 UTC, Morten Welinder
none Details | Review
Updated patch (5.61 KB, patch)
2010-03-01 21:57 UTC, Morten Welinder
accepted-commit_now Details | Review

Description Andreas J. Guelzow 2010-02-28 17:16:56 UTC
when asked for the existing locales, goffice appears to provide only a subset of the locales:

On my system I have:

[aguelzow@kirkman ~]$ locale -a
C
POSIX
de_DE.utf8
en_CA.utf8
en_GB.utf8
en_US.utf8
es_US.utf8
fr_CA.utf8
fr_FR.utf8
ru_RU.utf8
[aguelzow@kirkman ~]$

In gnumeric in the sort dialog I have only one locale available: C

Checking the code in go-locale-sel.c it is clear that when goffice uses setlocale to determine the existence of locales, it only uses a non-charmap version of the locale name, and there is no de_DE or en_CA etc. on my system.

Note that this is also reported as 
https://bugs.launchpad.net/ubuntu/+source/gnumeric/+bug/339325
Comment 1 Morten Welinder 2010-03-01 19:24:41 UTC
Hmm...

We have no good way of determining what locales are available; "locale -a"
certainly isn't standard.

I don't see anything wrong with trying adding ".utf8" and trying that first.
We certainly want utf8.

For the record, here's a part of what I see:

...
zh_CN
zh_CN.gb18030
zh_CN.gbk
zh_CN.utf8
zh_HK
zh_HK.utf8
zh_SG
zh_SG.gbk
zh_SG.utf8
zh_TW
...
Comment 2 Morten Welinder 2010-03-01 19:26:55 UTC
Note: we should not add "utf8" to "C"!
Comment 3 Morten Welinder 2010-03-01 19:40:02 UTC
Created attachment 154965 [details] [review]
Tentative patch

How about that?
Comment 4 Morten Welinder 2010-03-01 21:57:16 UTC
Created attachment 154979 [details] [review]
Updated patch
Comment 5 Andreas J. Guelzow 2010-03-02 17:40:15 UTC
Review of attachment 154979 [details] [review]:

looks good to me
Comment 6 Morten Welinder 2010-03-02 18:02:53 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.