On 21:53 Sun 07 Oct, Nicolas François wrote:
> Package: po4a
> Version: 0.32-1
> Severity: wishlist
> 
> Dear maintainer,
> 
> A po4aman-display-po equivalent for the POD format would allow translators
> to review their translations more easily.
>

As view on debian-l10n-french, find attached the po4apod-display-po
script that I use and it man page (I also modified po4aman-display-po
man page to add a reference to po4apod-display-po script).

Best Regard

Florentin Duneau


diff -uNr po4a-0.36.orig/scripts/po4aman-display-po.1 
po4a-0.36/scripts/po4aman-display-po.1
--- po4a-0.36.orig/scripts/po4aman-display-po.1 2009-03-16 22:42:23.000000000 
+0100
+++ po4a-0.36/scripts/po4aman-display-po.1      2009-03-19 21:53:19.000000000 
+0100
@@ -33,5 +33,15 @@
 .BI "\-o " PO4A_OPT
 Some options to pass to \fBpo4a-translate\fP.
 
+.SH BUGS
+\fBpo4aman-display-po\fP can fail if the man page was generated from a pod file
+with pod2man. In such case, see \fBpo4apod-display-po\fP.(1) which uses
+directly the pod file instead of the man page to generate the translated man
+page.  Generally, pod files are only available in source package or embedded
+in Perl script.
+
+.SH SEE ALSO
+\fBpo4apod-display-po\fP.(1)
+
 .SH AUTHOR
 Thomas Huriaux
diff -uNr po4a-0.36.orig/scripts/po4apod-display-po 
po4a-0.36/scripts/po4apod-display-po
--- po4a-0.36.orig/scripts/po4apod-display-po   1970-01-01 01:00:00.000000000 
+0100
+++ po4a-0.36/scripts/po4apod-display-po        2009-03-19 21:37:27.000000000 
+0100
@@ -0,0 +1,56 @@
+#!/bin/sh
+
+MASTER=""
+NAME=""
+SECTION=""
+PO=""
+UTF8=""
+
+function usage () {
+       echo "Usage : $(basename $0) -m POD_FILE -p PO_FILE"
+}
+
+while getopts m:p:uh option; do
+       case $option in
+       m)
+           MASTER=$OPTARG
+           ;;
+       p)
+           PO=$OPTARG
+           ;;
+       h)
+           usage
+           exit 0
+           ;;
+       [?])
+           usage 1>&2
+           exit 1
+           ;;
+    esac
+done
+
+if [[ -z $PO ||  -z $MASTER ]]; then
+    usage
+    exit 1
+fi
+
+if [ ! -f $PO ]; then
+    echo "Error: unable to find the file $PO."
+    usage 
+    exit 1
+fi
+
+if [ ! -f $MASTER ]; then
+    echo "Error: unable to find the file $MASTER."
+    usage
+    exit 1
+fi
+
+# Can fail to retrieve the expected result with various files...
+#NAME=$(basename $MASTER .pod | sed -e 's/\..//')
+#SECTION=$(basename $MASTER .pod | sed -e 's/.*\.//')
+
+po4a-translate -f pod -m $MASTER -p $PO \
+       | pod2man -r '' -c TRANSLATED -n $MASTER  \
+       | man -l -
+
diff -uNr po4a-0.36.orig/scripts/po4apod-display-po.1 
po4a-0.36/scripts/po4apod-display-po.1
--- po4a-0.36.orig/scripts/po4apod-display-po.1 1970-01-01 01:00:00.000000000 
+0100
+++ po4a-0.36/scripts/po4apod-display-po.1      2009-03-19 21:52:55.000000000 
+0100
@@ -0,0 +1,38 @@
+.TH PO4APOD-DISPLAY-PO 1 "2009-03-16" "Po4a Tools" "Po4a Tools"
+.SH NAME
+po4apod-display-po \- man display of a translated pod file according to a PO
+
+.SH SYNOPSIS
+.B po4apod-display-po
+.B \-p
+.I PO_FILE
+.B \-m
+.I POD_FILE
+.RB [ \-o
+.IR PO4A_OPT ]
+
+.SH DESCRIPTION
+\fBpo4apod-display-po\fP can be used by a translator who wants to check
+how the man page, generated from a pod file, being translated in a PO will 
+be displayed. Generally, pod file is only available in source package or
+embedded in Perl script.
+
+.SH OPTIONS
+.TP
+.BI "\-p " PO_FILE
+The PO file containing the translations.
+.TP
+.BI "\-m " POD_FILE
+The original pod file used by po4a to generate PO file.
+.br
+.TP
+.BI "\-o " PO4A_OPT
+Some options to pass to \fBpo4a-translate\fP.
+
+.SH SEE ALSO
+\fBpo4aman-display-po\fP.(1)
+
+.SH AUTHOR
+Florentin Duneau (originally based on \fBpo4aman-display-po\fP.(1) manpage 
+written by Thomas Huriaux.)
+

Reply via email to