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 106565 - popt --help messages not translated
popt --help messages not translated
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2003-02-19 22:52 UTC by Noah Levitt
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (703 bytes, patch)
2003-02-20 01:17 UTC, Mark McLoughlin
none Details | Review

Description Noah Levitt 2003-02-19 22:52:45 UTC
The popt --help messages (poptOptions.descrip) are marked for translation
with N_, and most have translations in the .po files, but they are never
translated with _().
Comment 1 Mark McLoughlin 2003-02-20 01:16:38 UTC
Is the attached patch a reasonable way to fix it ?
Comment 2 Mark McLoughlin 2003-02-20 01:17:20 UTC
Created attachment 14455 [details] [review]
patch
Comment 3 Glynn Foster 2003-02-20 01:35:03 UTC
Shouldn't this be done at the libgnome/gnome-program level? Doesn't
seem right to have that piece of code there. But since I have no clue
about this sort of stuff, I'll shut up now ;)
Comment 4 Glynn Foster 2003-02-20 01:38:17 UTC
At a really, really, really rough guess it could be ....

libgnome/libgnome/gnome-program.c

       for (i = 0; (a_module = g_ptr_array_index(program_modules, i));
i++) {
            if (a_module->options) {
                includer.arg = a_module->options;
                includer.descrip = L_((char *)a_module->description);

But I haven't tried that, and it probably doesn't work. Okay, this
time I'll shut up for sure ;)
Comment 5 Mark McLoughlin 2003-02-20 05:01:09 UTC
I'm pretty sure it won't work, that's why I didn't do it that way. The
translations are in the panel's translation domain but this will
translate them in the libgnome's translation domain ...
Comment 6 Mark McLoughlin 2003-02-24 01:34:06 UTC
Christian: any thoughts ?
Comment 7 Christian Rose 2003-02-24 11:08:36 UTC
Don't know, I'll ask around.
Comment 8 Yanko Kaneti 2003-02-24 11:32:12 UTC
Perhaps adding this to the poptOptions options[]  struct would help

{ NULL, '\0', POPT_ARG_INTL_DOMAIN, GETTEXT_PACKAGE, 0, NULL, NULL }

saw an example in libbonoboui
Comment 9 Kjartan Maraas 2003-04-22 15:39:04 UTC
Any new insight on this?
Comment 10 Kjartan Maraas 2003-07-08 23:09:48 UTC
Removing myself from Cc: since I'm already on the bugzilla-maint alias.
Comment 11 Vincent Untz 2003-11-13 15:19:54 UTC
Mark: this patch fixes it for me. Is it ok to commit?

Index: main.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/gnome-panel/main.c,v
retrieving revision 1.337
diff -u -r1.337 main.c
--- main.c      17 Sep 2003 20:30:16 -0000      1.337
+++ main.c      13 Nov 2003 15:19:12 -0000
@@ -52,6 +52,7 @@
 int
 main (int argc, char **argv)
 {
+       setlocale (LC_ALL, "");
        bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
        bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
        textdomain (GETTEXT_PACKAGE);
Comment 12 Mark McLoughlin 2003-11-13 15:25:14 UTC
No, it doesn't make any sense to me ... if this fixes the problem,
then something must be broken somewhere else, right ?
Comment 13 Vincent Untz 2003-11-13 16:29:04 UTC
Now is the time for my stupid question... How can a setlocale (LC_ALL,
"") translate N_() strings? It's not possible. So I guess there's
already something in libgnome handling the translation of the popt
strings.
Comment 14 Vincent Untz 2004-01-22 16:00:05 UTC
Hrm... What is the relation between this bug and bug #106549?
Comment 15 Christian Rose 2004-01-26 17:34:55 UTC
Chris?
Comment 16 Christian Neumair 2004-01-26 20:18:42 UTC
Excerpt from #106549:
"Calling setlocale(LC_ALL, "") or similar *before* the popt parses
--help option is definitely required"

setlocale is a standard call that actually sets the locale. It is
required to make gettext work.

On your N_() objection: This one has always been a #define N_(String)
String macro that simply registers String for translation (needed for
const variables). The actual translation is done using a gettext call
on _(var), again, you have to call it after setlocale to output
localized strings.
Anyway, its safe to have a setlocale in the beginning of your app
code, so you may want to commit the setlocale patch.

regs,
 Chris
Comment 17 Vincent Untz 2004-01-26 20:53:43 UTC
Christian: but isn't there a setlocale call in libgnome now?
Comment 18 Christian Neumair 2004-01-26 21:45:29 UTC
Yes, that's right, but it is more of a fallback since many apps forget
to call it which results in all those problems.
It's up to you, it doesn't make a difference.

regs,
 Chris
Comment 19 Vincent Untz 2004-01-27 12:05:15 UTC
Christian: I don't get it.
Why would it be a fallback? This really looks like a thing that should
be done in libgnome so no program would have to call setlocale(). So
why would we want to call setlocale in every program?

(sorry if I'm slow at understanding :-))
Comment 20 Mark McLoughlin 2004-02-13 17:14:12 UTC
Okay, my understanding here is that this has been fixed in libgnome.
Re-open if that isn't the case.