bug-hello
[Top][All Lists]
Advanced

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

Re: What governs whether a project includes help2man?


From: Karl Berry
Subject: Re: What governs whether a project includes help2man?
Date: Mon, 21 May 2007 17:16:26 -0500

Looking into it further, I see that for man pages generated by help2man,
help2man itself contains a lot of advice about this, and itself serves
as an example.  It is unfortunately less than simple.  Here is a bit
from help2man/Makefile.in that installs its man page in French:

$(target).fr.1: po/fr.gmo $(target) $(srcdir)/$(target).fr.h2m
        $(MAKE) preload
        LD_PRELOAD="./$(preload).so preloadable_libintl.so" \
        TEXTDOMAIN=help2man \
        ./$(target) --include=$(srcdir)/$(target).fr.h2m \
            --output=$@ address@hidden ./$(target)

(Just download the package from ftp://ftp.gnu.org/gnu/help2man/ to get
the real file with all the variables defined.  It's probably mostly
pretty obvious.)

And below is a bit from the manual explaining the story.

Hope this helps.
karl


File: help2man.info,  Node: Localised man pages

6 Producing Native Langauge 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 address@hidden -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 address@hidden -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 address@hidden' 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 (*note Reports::).

   ---------- Footnotes ----------

   (1) `help2man' currently supports `fr_FR' and `pl_PL' (*note
Reports:: for how to submit other translations).






reply via email to

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