bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnulib] getopt depending on gettext


From: Werner LEMBERG
Subject: Re: [bug-gnulib] getopt depending on gettext
Date: Tue, 31 May 2005 15:41:22 +0200 (CEST)

> > I think it is a *bad* idea to make getopt depend on gettext
> > unconditionally.
>
> Is this because groff uses getopt but not gettext?

Exactly.  Adding gettext support to groff would be nice, but until now
it hasn't happened.

> What about the other gnulib modules that depend on gettext?  Here is a
> list.  Shouldn't they be in the same category as getopt here?

The less dependencies, the better IMHO.  Most modules have gettext for
internationalized messages only, right?  I think it is better to leave
it to the application whether gettext support is wanted or not.

> E.g., you could do this:
>
> #if ENABLE_NLS
> # include "gettext.h"
> # define _(msgid) gettext (msgid)
> #else
> # define _(msgid) msgid
> #endif

You mean such a code could be added to getopt.c, right?

> But here's a simpler thought: leave getopt.c alone, and simply
> distribute unmodified gettext.h with groff.  That should work.
> gettext.h does not need the other parts of the gettext module.

To be honest, I consider this not elegant.  Distributing a header file
just for the sake of satisfying a dependency looks like a hack.

> One way to do this would be to remove the dependency of the modules
> listed above on "gettext", but add "gettext.h" to each of these
> module's files.  That would be a simple change to gnulib, that
> wouldn't require changing any source files.

I really prefer a `real' fix, this is, adding the above code to the
affected source files.  For me, it looks `more right'.


    Werner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]