#!/bin/sh
#
# Run this command in the top level directory to create the
# translation template:


# the following command extracts the strings needing a translation
# from prepared perl script file. File test1.pl and test2.pl are
# examples for these files

xgettext -o /tmp/template-pl.pot \
         scripts/test1.pl \
         scripts/test2.pl 

# the following command extracts the strings needing a translation 
# from groff files that produce manpages 

po4a-updatepo -f man \
              --option groff_code=verbatim \
              -m doc/w3m.1 \
              -m scripts/w3mman/w3mman.1.in \
              -p /tmp/template-man.pot


# the following commands extract the strings needing a translation
# from w3m's documentation in HTML-files. FAQ_jbr141208.html and
# MANUAL_jbr141208.html are examples

html2po -i doc/FAQ_jbr141208.html -o /tmp/template-html1.pot 
html2po -i doc/MANUAL_jbr141208.html -o /tmp/template-html2.pot 
#html2po -i w3mhelp-w3m_en.html.in -o /tmp/template-html3.pot

# the following command collects the message strings from the partial
# pot-files and produces one message catalog with all strings used in
# w3m's support and documentation

msgcat -w 80 -t utf-8 \
         --use-first \
       /tmp/template-pl.pot \
       /tmp/template-man.pot \
       /tmp/template-html?.pot \
       > po/template.pot 

