Package: po4a
Version: 0.39-1
Severity: wishlist
Tags: patch

As discussed in the thread starting at [1] currently po4a is a little
intimidating for new users as it is a complex framework. Thus after
having worked out the details myself (using the exisiting man page) I
propose the attached patch to add an example section to the man page
to guide new users through integration of po4a in their debian/rules.
I tried to word it generically to also adress other users. Feel free
to improve it (including formatting).

It would be great if you could apply it for your next release.


[1] http://lists.debian.org/debian-i18n/2009/12/msg00082.html

-- 
      Dr. Helge Kreutzmann                     [email protected]
           Dipl.-Phys.                   http://www.helgefjell.de/debian.php
        64bit GNU powered                     gpg signed mail preferred
           Help keep free software "libre": http://www.ffii.de/
--- po4a.orig	2010-02-02 01:10:39.000000000 +0100
+++ po4a	2010-02-27 18:18:59.000000000 +0100
@@ -57,6 +57,8 @@
 
 =head2 OPTIONS
 
+=head2 EXAMPLE
+
 =head2 SHORTCOMINGS
 
 =head2 SEE ALSO
@@ -438,6 +440,63 @@
 
 =back
 
+=head2 EXAMPLE
+
+Let's assume you maintain foo which has a man page foo.man which naturally
+is maintained in English only. Now you as the upstream or downstream 
+maintainer want to create and maintain the translation. First you need to
+create the pot file necessary to send to translators using po4a-gettextize(1).
+
+So for our case we would call
+
+po4a-gettextize -f man -m foo.1 -p foo.pot
+
+You would then send this file to the appropriate language lists (e.g.
+debian-i18n using podebconf-call(1) if you are a Debian maintainer) or offer
+it for download somewhere on your website. You could also store it in 
+your source repository, but let's assume you don't want to do this as this
+file can be easily autogenerated with the above command.
+
+Now let's assume you received three translations before your next release:
+de.po (including an addendum de.add), sv.po and pt.po. Since you don't want
+to change your makefile(s) whenever a new translation arrives you can use
+po4a with an appropriate configuration file in your makefile. Let's call it 
+po4a.cfg. In our example it would look like the following:
+
+[po_directory] man/
+
+[type: man] foo.man $lang:man/foo.$lang.man \
+            add_$lang:?*man/foo.$lang.add opt:"-k 80"
+
+In this example we assume that your generated man pages (and all po and add
+files) should be stored in man/ below the current directory. In our example
+this directory would include de.po, de.add, pt.po and sv.po.
+
+Note the use of the modifier '?' as only the German translation (de.po) is 
+accompanied by an addendum.
+
+To actually build the translated man pages you would then (once!) add the
+following two lines in the build target of the appropriate makefile:
+
+        touch man/foo.pot
+	po4a -f po4a.cfg
+
+Note the use of the parameter '-f' as there is no intermediate pot file.
+
+Once this is set up you don't need to touch the makefile when a new 
+translation arrives, i.e. if the French team sends you fr.po and fr.add then
+you simply drop it in man/ and the next time the programm is build the 
+French translation is automatically build as well.
+
+Note that you still need an appropriate install target, e.g. for a 
+debian/rules file you would add the following line
+
+        dh_installman foo.man man/foo.de.man man/foo.pt.man man/foo.sv.man
+
+Finally you will need a line in your clean target as well:
+        -rm -f man/foo.*man
+        -rm -f man/foo.pot
+
 =head1 SHORTCOMINGS
 
 =over 4

Attachment: signature.asc
Description: Digital signature

Reply via email to