GNOME Bugzilla – Bug 760425
[PATCH] gnome-session --help and gnome-session-quit --help shows translated characters as question marks on some locales
Last modified: 2016-01-24 14:47:23 UTC
Please see the attached patch. gnome-session-binary and gnome-session-quit should call setlocale in main function in order to correctly show translated messages. Running 'gnome-session --help' with zh_TW.UTF-8 locale shows: ??? gnome-session-binary [???] - GNOME ??????? ????? -h, --help ??????? ??????? -a, --autostart=AUTOSTART_DIR ??????????? --session=SESSION_NAME ???????? --debug ????? -f, --failsafe ?????????????? --version ??????? --whale ????????????? --disable-acceleration-check ???????? Running 'gnome-session-quit --help' with zh_TW.UTF-8 locale shows: ??? gnome-session-quit [???] ????? -h, --help ??????? ??????? --logout ?? --power-off ???? --reboot ???? --force ??????????? --no-prompt ???????
Created attachment 318693 [details] [review] Call setlocale in main function of gnome-session-binary and gnome-session-quit It is required to correctly show translated messages on some locales.
Looks right to me
Attachment 318693 [details] pushed as 788b64a - Call setlocale in main function of gnome-session-binary and gnome-session-quit
Note that for Linux you need to #include <locale.h> when you do this; we have fixup commits to do this for both GDM and Epiphany.
(I mean gnome-session, not GDM.)
Yes, I failed to notice the difference in between libintl.h provided by gettext-runtime and glibc when submitting patches. The version provided by glibc only includes locale.h when optimization is enabled, while the version provided by gettext-runtime always includes locale.h. I checked remaining 13 bug reports and patches. Only 1 of them needs updating, and I updated it to include locale.h just now.