#! /bin/sh # Rebuild the documentation and upload this to the web server. # # it does use the Marek's implementation of the pod2html converter. # You can find it from the CPAN, and I have a debian package of it on my # my web page. # # Mt. #set -e #set -x function percent_lang { STATS=`msgfmt --statistics po/pod/$1.po 2>&1` YES=`echo $STATS | sed -n -e 's/^\([[:digit:]]*\).*$/\1/p'` NO=`echo $STATS | sed -n -e 's/^\([[:digit:]]\+\)[^[:digit:]]\+\([[:digit:]]\+\).*$/\2/p'` O3=`echo $STATS | sed -n -e 's/^\([[:digit:]]\+\)[^[:digit:]]\+\([[:digit:]]\+\)[^[:digit:]]\+\([[:digit:]]\+\).*$/\3/p'` if [ $O3 ]; then NO=$(($NO + $O3)) fi TOTAL=$(($YES+$NO)) echo $((($YES*100)/$TOTAL)) } POFILES=`cd po/pod; ls *.po` LANGS=${POFILES//.po/} FILES="doc/po4a.7.pod po4a po4a-*" PO4A_OPTS="-k 0 -v -f pod" rm -rf html/ mkdir -p html/en/ mpod2html -dir=html/en -tocname index $FILES lib echo "po4a

po4a

The po4a (po for anything) project goal is to ease translations (and more interestingly, the maintenance of translations) using gettext tools on areas where they were not expected like documentation.


English documentation: Introduction Index

Documentation translations:
" > html/index.html for lang in $LANGS ; do mkdir -p html/$lang html/tmp #Translate $FILES for file in $FILES ; do newfile=${file##*/} PERL5LIB=lib perl po4a-translate $PO4A_OPTS -p po/pod/$lang.po -m $file -l html/tmp/$newfile done mkdir -p html/tmp/lib/Locale/Po4a #Translate modules for file in lib/Locale/Po4a/*.pm ; do newfile=${file##*/} PERL5LIB=lib perl po4a-translate $PO4A_OPTS -m $file -p po/pod/$lang.po -l html/tmp/lib/Locale/Po4a/$newfile done mpod2html -dir=html/$lang -tocname index html/tmp/* rm -rf html/tmp PERC=`percent_lang $lang` echo "$lang ($PERC% translated): Introduction Index
" >> html/index.html done echo "
Alioth project page

Last update: `LANG=C date`
" >> html/index.html scp -r html/* po4a.alioth.debian.org:/var/lib/gforge/chroot/home/groups/po4a/htdocs/