/[d-i]/trunk/manual/scripts/update_pot
ViewVC logotype

Contents of /trunk/manual/scripts/update_pot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 34670 - (show annotations) (download)
Wed Feb 1 00:14:39 2006 UTC (7 years, 3 months ago) by fjp
File size: 1862 byte(s)
Deal with changes in poxml 3.5.0
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 for XML in `find $SOURCEDIR -name "*.xml"` ; do
33 echo "Creating new POT file for $XML"
34 POT=$(basename $XML .xml).pot
35
36 # Let's also set a proper POT-Creation-Date
37 # The hack to set the POT creation date is no longer needed for poxml 3.5.0
38 # But the authors of poxml also decided to set some nice KDE defaults we
39 # don't want...
40 xml2pot $XML | \
41 sed "s/^.*Report-Msgid-Bugs-To:.*$/\"Report-Msgid-Bugs-To: debian-boot@lists.debian.org\\\n\"/" | \
42 sed "s/^.*Language-Team:.*$/\"Language-Team: LANGUAGE <LL@li.org>\\\n\"/" | \
43 sed "s/^.*POT-Creation-Date:.*$/\"POT-Creation-Date: $(date -u "+%F %R%z")\\\n\"/" \
44 >$PODIR/pot/$POT.new
45 RC=$?
46 if [ $RC -ne 0 ] ; then
47 RET=$RC
48 echo "Error: error $RC while executing xml2pot"
49 fi
50
51 if [ ! -f $PODIR/pot/$POT ] ; then
52 mv $PODIR/pot/$POT.new $PODIR/pot/$POT
53 else
54 if diff $PODIR/pot/$POT $PODIR/pot/$POT.new | grep "^[><]" | grep -qv "POT-Creation-Date: " ; then
55 mv $PODIR/pot/$POT.new $PODIR/pot/$POT
56 else
57 # Revert changes if the only thing changed is the POT-Creation-Date
58 rm $PODIR/pot/$POT.new
59 fi
60 fi
61 done
62
63 exit $RET

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5