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 765455 - goa-daemon --help shows translated characters as question marks on some locales
goa-daemon --help shows translated characters as question marks on some locales
Status: RESOLVED FIXED
Product: gnome-online-accounts
Classification: Core
Component: general
3.20.x
Other All
: Normal normal
: ---
Assigned To: GNOME Online Accounts maintainer(s)
GNOME Online Accounts maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2016-04-23 07:49 UTC by Ting-Wei Lan
Modified: 2016-04-28 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
daemon, examples, identity: Call setlocale and gettext functions (4.14 KB, patch)
2016-04-23 07:51 UTC, Ting-Wei Lan
none Details | Review
identity: Update POTFILES.in and remove redundant includes (1.75 KB, patch)
2016-04-26 15:30 UTC, Debarshi Ray
committed Details | Review
identity: Include the correct internationalization header (849 bytes, patch)
2016-04-26 15:30 UTC, Debarshi Ray
committed Details | Review
daemon, examples, identity: Call setlocale and gettext functions (4.24 KB, patch)
2016-04-26 15:31 UTC, Debarshi Ray
committed Details | Review

Description Ting-Wei Lan 2016-04-23 07:49:21 UTC
I know goa-daemon is not a command intended to be run by users, but it is still better to keep the message readable.

Running 'goa-daemon --help' with zh_TW.UTF-8 locale shows:
???
  goa-daemon [???] GNOME Online Accounts daemon

?????
  -h, --help       ???????

???????
  --replace        Replace existing daemon
  --no-sigint      Do not handle SIGINT for controlled shutdown

Please see the attached patch. goa-daemon and other GOA programs should call setlocale and gettext functions in their main function.
Comment 1 Ting-Wei Lan 2016-04-23 07:51:57 UTC
Created attachment 326589 [details] [review]
daemon, examples, identity: Call setlocale and gettext functions

Calling these functions is required to make message translation work.
Comment 2 Debarshi Ray 2016-04-26 15:29:31 UTC
Review of attachment 326589 [details] [review]:

Thanks for the patch.

::: src/daemon/main.c
@@ +22,3 @@
 #include <glib-unix.h>
 
+#include <locale.h>

Strictly speaking we should include libintl.h, not gi18n.h.

::: src/goaidentity/main.c
@@ +22,3 @@
 #include <glib-unix.h>
 
+#include <locale.h>

Strictly speaking we should include libintl.h, not gi18n.h.
Comment 3 Debarshi Ray 2016-04-26 15:30:13 UTC
Created attachment 326784 [details] [review]
identity: Update POTFILES.in and remove redundant includes
Comment 4 Debarshi Ray 2016-04-26 15:30:48 UTC
Created attachment 326785 [details] [review]
identity: Include the correct internationalization header
Comment 5 Debarshi Ray 2016-04-26 15:31:40 UTC
Created attachment 326786 [details] [review]
daemon, examples, identity: Call setlocale and gettext functions

I took the liberty to fix up the previous patch.
Comment 6 Debarshi Ray 2016-04-26 15:36:02 UTC
Pushed all three to master.