Skip site navigation (1) Skip section navigation (2)

Re: Cleanup for gettext() calls

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Cleanup for gettext() calls
Date: 2005-02-15 01:04:22
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > It also adds some missing gettext usage, particularly in src/port and
> > interfaces/ecpg.
> ecpg has no translation support, so that would be pretty pointless.

Well, gettext is coming into ecpglib via a symlink to port/exec.c:

	./ecpglib/exec.c:               log_error(gettext("could not identify current directory: %s"),

Seems we should enable internationalization for ecpg, at least for the
--help strings and stuff.

Peter says that the gettext() doesn't do anything if it isn't
initialized so I guess exec.c is OK.  Does someone want to set up the
proper gettext initialization for ecpg so we can have this for 8.1? 
ecpglib needs special library initialization like libpq.

> > I found that perl also defines _(x) so I undefined this in plperl.
> That kind of thing was the reason that it wasn't defined globally.

Yea.  I have Perl handled.  I think we should just do with the _(x) and
if we find problems we can change them to _e(x) or something.

> > Also, what is gettext_noop(x) used for?
> It marks strings for translation for the purpose of xgettext but does 
> not call gettext because it would not be valid program code at that 
> place.

OK I have added a comment to explain this:
	 *  These strings are to be translation via xgettext.  We can't
	 *  call gettext() because it is located in variable initialization and
	 *  a function call can not be used.
	#define gettext_noop


  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to


pgsql-patches by date

Next:From: Bruce MomjianDate: 2005-02-15 01:34:38
Subject: Re: using strxfrm for having multi locale/please vote for
Previous:From: Peter EisentrautDate: 2005-02-14 23:36:52
Subject: Re: Cleanup for gettext() calls

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group