From: | Franck Martin <franck(at)sopac(dot)org> |
---|---|
To: | Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: 7.2 items |
Date: | 2001-05-14 08:24:26 |
Message-ID: | 3AFF963A.F9D9B147@sopac.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(String) gettext (String)
# define N_(String) (String)
#else
/* Stubs that do something close enough. */
# define textdomain(String)
# define gettext(String) (String)
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory)
# define _(String) (String)
# define N_(String) (String)
#endif
Just add the above code to each file, and each time that you use a string "my
string" encapsulate it with _("my string"). gettext will parse the code and
extract all the strings for future translation.
Cheers
Karel Zak wrote:
> On Sat, May 12, 2001 at 11:21:44PM +0200, Peter Eisentraut wrote:
> > Tom Lane writes:
> >
> > > Peter E. had implied that he wanted to tackle the elog issues for 7.2,
> > > but I'm not sure if he's committed to it or not.
> >
> > Well...
> >
> > * Automatically add filename, line, function name: Easy to code, lots of
> > labour. Should be lumped in with some other large change.
> >
> > * Error codes: I think there are only a handful of key messages that
> > users (programs) need to detect cleanly, mostly constraint violations.
> > The rest are "the query you sent is wrong -- fix your application" and
> > "something went really wrong -- manual repair needed"
> >
> > So maybe this could be a smallish change.
> >
> > * Translation: If we want to use gettext I can get started. I don't
> > think I'm interested in using any other interface.
>
> What dissect this work to two parts? First implement error codes and later
> translation. IMHO transaction hasn't big importance (and will encapsulate
> in elog() stuff) and is possible speculate about it later. Do you plannig
> gettext stuff as a ./configure option?
>
> Karel
>
> --
> Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
> http://home.zf.jcu.cz/~zakkr/
>
> C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
From | Date | Subject | |
---|---|---|---|
Next Message | Kovacs Zoltan | 2001-05-14 08:38:08 | bug in PLPGSQL |
Previous Message | Ian Lance Taylor | 2001-05-14 07:56:34 | Re: Re: PL/Python build |