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: Relocatable locale |
Date: | 2004-05-26 18:59:51 |
Message-ID: | 200405261859.i4QIxpv08623@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > I have two questions. First, setlocale() seemed to be inconsistently
> > set inside and outside of ENABLE_NLS. I assume the proper location
> > is inside.
>
> No, in case of doubt it's outside.
OK, moved. New code is:
void
set_pglocale(const char *argv0, const char *app)
{
#ifdef ENABLE_NLS
char path[MAXPGPATH];
char my_exec_path[MAXPGPATH];
#endif
/* don't set LC_ALL in the backend */
if (strcmp(app, "postgres") != 0)
setlocale(LC_ALL, "");
#ifdef ENABLE_NLS
if (find_my_exec(argv0, my_exec_path) < 0)
return;
get_locale_path(my_exec_path, path);
bindtextdomain(app, path);
textdomain(app);
#endif
}
>
> > Second, libpq has a locale setting for error messages,
> > but a libpq program could be in any directory, so I see no way to
> > make that relocatable. Instead, I just use the hardcoded path. I
> > could make it relocatable, but that seems to error-prone, plus I
> > would have to look up the exec path and stuff, and it seemed too
> > complicated.
>
> Hmm, so this says that a relocatable install isn't in fact possible?
Yep. I don't see how you can have a library know where to look for its
localized messages. The only thing I can think of is an environment
variable to override the hard-coded default. How is that?
--
Bruce Momjian | http://candle.pha.pa.us
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
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2004-05-26 19:48:19 | Re: Relocatable locale |
Previous Message | Bruce Momjian | 2004-05-26 18:50:28 | Re: Cancel/Kill backend functions |