~qbalazs/installation-guide/lp1030336

« back to all changes in this revision

Viewing changes to scripts/update_pot

  • Committer: joeyh
  • Date: 2005-10-07 19:51:38 UTC
  • Revision ID: vcs-imports@canonical.com-20051007195138-c3d57b2617a79a4f
move manual to top-level directory, split out of debian-installer package

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# This script is used for translations using .po files.
 
4
# It updates .pot files after changes in the original English
 
5
# .xml files.
 
6
# The script 'merge_xml' should be run before this script!
 
7
 
 
8
if [ "$1" = "--help" ] ; then
 
9
    echo "Usage: $0"
 
10
    exit 0
 
11
fi
 
12
 
 
13
if [ -z "`which xml2pot 2>/dev/null`"  ] ; then
 
14
   echo "ERR: xml2pot not found, please install the poxml package"
 
15
   exit 1
 
16
fi
 
17
 
 
18
BUILDDIR="./build"
 
19
if [ -z "$PO_USEBUILD" ] ; then
 
20
    WORKDIR="./integrated"
 
21
    PODIR="./po"
 
22
else
 
23
    WORKDIR="$BUILDDIR/build.po"
 
24
    PODIR="$BUILDDIR/build.po"
 
25
fi
 
26
SOURCEDIR="$WORKDIR/en"
 
27
RET=0
 
28
 
 
29
[ -d $SOURCE ] || exit 1
 
30
mkdir -p $PODIR/pot
 
31
 
 
32
# This check is broken!
 
33
if [ -n "$(find $PODIR/pot/ -name *.pot 2>/dev/null)" ] ; then
 
34
    echo "Deleting old POT files..."
 
35
    rm $PODIR/pot/*.pot
 
36
fi
 
37
 
 
38
for XML in `find $SOURCEDIR -name "*.xml"` ; do
 
39
    echo "Creating new POT file for $XML"
 
40
    POT=$(basename $XML .xml).pot
 
41
 
 
42
    xml2pot $XML >$PODIR/pot/$POT
 
43
    RC=$?
 
44
    if [ $RC -ne 0 ] ; then
 
45
        RET=$RC
 
46
        echo "Error: error $RC while executing xml2pot"
 
47
    fi
 
48
done
 
49
 
 
50
exit $RET