bug-glibc
[Top][All Lists]
Advanced

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

Re: gettext: locale.alias file not read with different TEXTDOMAINDIR


From: Ben Hochstedler
Subject: Re: gettext: locale.alias file not read with different TEXTDOMAINDIR
Date: Tue, 28 Nov 2000 15:53:07 -0600

Ulrich,

> > If the default, compiled in locale directory is not available,
> > gettext() will not succeed if $LANG/$LANGUAGE setting is not the
> > name of a directory under $TEXTDOMAINDIR.  The attached patch
> > makes it so that the directory to which a domain is bound is
> > also searched for a locale.alias file if one isn't found in
> > the locale dir path.
> 
> That's not what it is intended to do.  The current code is correct.

Perhaps the requirements on what gettext is supposed to do should be
changed then.  I'd appreciate it if you could explain why the
locale.alias file in an alternative locale directory should not be
used.  A good example of why the locale.alias file in the directory
specified by TEXTDOMAINDIR should be used is that it can have an alias
that isn't in the standard locale.alias file.  This means that instead
of using an alias as intended, the user is forced to either:
a) set their locale to the name of the directory under the alternative
   locale directory which contains the mo files, or
b) run their program in the alternative locale directory.

An alternative design would be to let the user set a LOCALE_ALIAS_PATH
environment variable which would override the default path
compiled into libintl/gettext.

Here's another a real-life example of why this change makes sense
for an embedded system:

The basic OS components that never change are installed on a flash
ROM.  Everything else that may get updated is installed on a disk
partion.  gettext is built so that the default locale directory is
on the writeable partition, but itself is installed on the root
filesystem. When the system is coming up, if the writeable partition
is dirty and needs to be fsck'ed, a message is written to the console
after being looked up with gettext (the locale setting is stored in a
writeable EEPROM). Therefore, the default locale.alias file which is
on the not yet mounted partition can't be used, and the one on the
ROMed filesystem has to be used instead.

The reason why gettext isn't built so that the default locale dir
is the one on the ROM filesystem is because it is desirable to
have it use the one on the writeable filesystem as much as possible
because it may be more up-to-date.  It's also undesirable to have two
different gettexts installed where the one on the root filesystem
has its default locale directory different than the one on the
writeable partition, so that when the writeable partition is mounted
that its gettext is used instead.  This makes it so that one has
to be very careful on how their PATH is setup.

-Ben

-- 
Ben Hochstedler         GE Medical Systems Information Technologies
address@hidden         http://www.gemedicalsystems.com/
Phone: 414-362-3317      Fax: 414-362-3389      Dial-comm: 401-3317



reply via email to

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