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 696179 - folks-inspect, folks-import do not attempt to use translations
folks-inspect, folks-import do not attempt to use translations
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: folks-inspect
git master
Other Linux
: Normal normal
: Unset
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2013-03-20 11:25 UTC by Simon McVittie
Modified: 2013-03-20 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
folks-inspect, folks-import: initialize localization from the environment (1.41 KB, patch)
2013-03-20 11:35 UTC, Simon McVittie
committed Details | Review
TestCase: set locale from the environment (1.17 KB, patch)
2013-03-20 11:36 UTC, Simon McVittie
committed Details | Review

Description Simon McVittie 2013-03-20 11:25:36 UTC
While confirming whether <https://bugzilla.gnome.org/show_bug.cgi?id=690830#c15> was right, I looked at GNU hello to check how i18n pedants do this sort of thing.

It turns out that unless we call setlocale (LC_ALL, "") (or in Vala: Intl.setlocale (LocaleCategory.ALL, "")), the utilities won't actually respect any of the l10n-related environment variables.
Comment 1 Simon McVittie 2013-03-20 11:35:16 UTC
Created attachment 239342 [details] [review]
folks-inspect, folks-import: initialize localization  from the environment

Otherwise, $LANG etc. are ignored and we stay in the C locale.
Comment 2 Simon McVittie 2013-03-20 11:36:28 UTC
Created attachment 239343 [details] [review]
TestCase: set locale from the environment

This fixes an annoyance I'd had for a while: UTF-8 arrows etc.
in debug messages came out as "?", because until we call setlocale()
we're in the C locale, whose character set is ASCII (and some layer
of library responds by transcoding our strings into ASCII).

With this change, running the tests in en_GB.UTF-8 results in
Unicode arrows and more comprehensible output.

---

I would also be OK with the resolution being "don't use UTF-8 in debug()".
Comment 3 Philip Withnall 2013-03-20 13:20:53 UTC
Review of attachment 239342 [details] [review]:

++
Comment 4 Philip Withnall 2013-03-20 13:21:16 UTC
Review of attachment 239343 [details] [review]:

++
Comment 5 Philip Withnall 2013-03-20 13:21:41 UTC
(In reply to comment #2)
> I would also be OK with the resolution being "don't use UTF-8 in debug()".

I wouldn’t! :-P
Comment 6 Simon McVittie 2013-03-20 16:54:50 UTC
Comment on attachment 239342 [details] [review]
folks-inspect, folks-import: initialize localization  from the environment

0f8247ac
Comment 7 Simon McVittie 2013-03-20 16:54:57 UTC
Comment on attachment 239343 [details] [review]
TestCase: set locale from the environment

93d0f7d
Comment 8 Simon McVittie 2013-03-20 16:55:22 UTC
fixed in git for 0.9.2