[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
libintl adjusting local search paths by environment variable
From: |
Witold Baryluk |
Subject: |
libintl adjusting local search paths by environment variable |
Date: |
Thu, 24 Sep 2020 19:05:04 +0000 |
Hi,
I just started using gettext, and tried to find answer to this
question with no success.
Story:
As a translator it might be sometimes hard to check translations easily.
This is because compiled programs will search by default in system
specific data directories, and installing files there 1) require root
privileges, 2) might break other non-testing instances of the program.
And adjusting the paths using bindtextdomains in the code is not best
either, because that requires knowledge of the programming language,
source code and build tools, which is not necessarily what translators
know how to do. It can also be very time consuming.
I found some claims a LANGUAGE env variable can contains paths, but I
found that to not to be true (as I checked strace and ltrace of the
program).
It would be nice to use unmodified binary, and prepend search paths.
GETTEXT_PATHS=adriconf=/home/user/.loca/share/locale
to adjust the search path.
or
GETTEXT_GMO=adriconf=./pl.gmo
to force directly a specific translation, independent of what
LC_MESSAGES / LANG / LC_ALL / LANGUAGE says.
or something like that.
Both of these env variables could contain multiple domains (probably
separated by colon as it is used to).
Is it already possible, and where it is documented?
If not, why not? Are there better tools to do the same?
(requirements: no root, no program recompile).
Thanks,
Witold
- libintl adjusting local search paths by environment variable,
Witold Baryluk <=