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

Re: gettext documentation not accurate for Debian?

Avery Pennarun wrote:
> >   b) "remove these definitions" will end up in the following errors:
> > 
> >      this.o: In function `main':
> >      this.o(.text+0x28): undefined reference to `_'
> > 
> >      Instead you have to turn these definitions into the following in
> >      order to get your program compiled.
> > 
> >      #define _(String) (String)
> >      #define N_(String) (String)
> Hmm, my understanding was that _(String) was just another way to say
> gettext(String).  So, you can #define this:
> 	#define _(String) gettext(String)

Indeed.  I quoted the wrong line.  I added your line to my program
and it worked.

> And you should be okay.  Now, I've never actually used gettext, so I don't
> know if this macro used to be defined, but now isn't in libc6.
> In any case, libintl.h certainly doesn't seem to have the _() define
> nowadays.  I don't know what N_() does, but perhaps something else in
> libintl.h will look right.

_(string) will be added to the pot file, N_(string) won't be added.

Of course, you have to call xgettext with --keyword=_ otherwise you
won't see anything.  Yeah, this documentation rules...



A mathematician is a machine for converting coffee into theorems.

Reply to: