(help2man.info.gz) Localised man pages
Info Catalog
(help2man.info.gz) Makefile usage
(help2man.info.gz) Top
(help2man.info.gz) Reports
6 Producing Native Language Manual Pages.
*****************************************
Manual pages may be produced for any locale supported by both the
program and `help2man'(1) with the `--locale' (`-L') option.
help2man -L fr_FR@euro -o cp.fr.1 cp
6.1 Changing the Location of Message Catalogs
=============================================
When creating localised manual pages from a program's build directory it
is probable that the translations installed in the standard location
will not be (if installed at all) correct for the version of the
program being built.
A preloadable library is provided with `help2man' which will
intercept `open(2)' calls for message catalogs for the domain given by
`$TEXTDOMAIN' and re-map the requests to the appropriate file under
`./po' (or `$LOCALEDIR' if given).
So for example:
LD_PRELOAD="hacklocaledir.so preloadable_libintl.so" TEXTDOMAIN=PROG \
help2man -L fr_FR@euro -i PROG.fr.h2m -o PROG.fr.1 PROG
will translate requests by PROG for
`/usr/share/locale/fr/LC_MESSGAES/PROG.mo' to `po/fr.gmo'.
Notes:
* The generalisation of `fr_FR@euro' to `fr' in the example above is
done by `gettext', if a more specific match were available it
would also have been re-mapped.
* The inclusion of `preloadable_libintl.so' in `$LD_PRELOAD' is
required only for cases (such as `glibc') where `gettext' is built
into libc (where `__open' would otherwise be satisfied internally).
* This preload hack has only been tested against `glibc' 2.3.1 and
`gettext' 2.3.1 on a GNU/Linux system; let me know if it does (or
doesn't) work for you ( Reports).
---------- Footnotes ----------
(1) `help2man' currently supports `fr_FR' and `pl_PL' (
Reports for how to submit other translations).
Info Catalog
(help2man.info.gz) Makefile usage
(help2man.info.gz) Top
(help2man.info.gz) Reports
automatically generated byinfo2html