Unlike all other aspects of locale information, message catalogs are found only in the location compiled into the binary. Environment variables such as LOCPATH do not affect the search. The gettext command honors a TEXTDOMAINDIR environment variable, but nothing else does. It would be best, in my opinion, if LOCPATH worked as it does for other locale information.
[ Please, disregard the previous message ]. Hello. I received this from the Debian Bug System. Package: gettext Version: 0.10.40-1 Severity: normal Unlike all other aspects of locale information, message catalogs are found only in the location compiled into the binary. Environment variables such as LOCPATH do not affect the search. The gettext command honors a TEXTDOMAINDIR environment variable, but nothing else does. It would be best, in my opinion, if LOCPATH worked as it does for other locale information.
Zack Weinberg wrote: sometimes install new packages. They would tend to set the LOCPATH environment variables to include all the directories where they have installed packages, like /usr/local, /opt/kde, etc. Since LOCPATH applies affects the startup time of all programs, in would quite significantly affect the performance of the system. For these reasons, it's better to keep LOCPATH and TEXTDOMAINDIR separate. Bruno
Okay, but then TEXTDOMAINDIR should be honored by all libgettext-using programs, not just the gettext command. Right now, there is *no way* to override the compiled-in path in most libgettext-using programs. zw
POSIX 1003.1-2001 specifies an NLSPATH environment variable for this purpose. POSIX requires only only the catopen family of functions, but it's natural for the gettext family to use NLSPATH too, and that is how Solaris gettext(3c) does things. Shouldn't the GNU gettext function family support NLSPATH?
Zack Weinberg wrote: This is not true. Assuming you as a user or translator have your private Italian translations in $HOME/my-translations/it, then you can cause gettext to use your translations in preferrence of / in addition to the preinstalled Italian ones by setting the environment variable $ export LANGUAGE=../../../../../../$HOME/my-translations/it:it This works because the elements of the LANGUAGE specifications can be relative pathnames. In gettext 0.11.3, and maybe also glibc 2.3, you'll be able to use absolute pathnames inside LANGUAGE, so that you can write $ export LANGUAGE=$HOME/my-translations/it:it Bruno
Paul Eggert wrote: I don't think this is possible without major hassles. NLSPATH (see its description in susv3/basedefs/xbd_chap08.html) contains filename templates, usually ending in ".cat". If we were to add ".mo" file templates there as well, it's likely that catopen attempts to open a .mo file, or that gettext attempts to open a .cat file. Furthermore NLSPATH usually points into $prefix/lib, whereas .mo files are located in $prefix/share. Bruno
Is this documented anywhere? And, speaking as a user, I find TEXTDOMAINDIR dramatically easier to comprehend than this - this looks like an ugly hack, frankly. zw