summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tl-update-messages
blob: 21088c3f3dd402a074ee22b1b441179204cf1dad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh -e
# $Id$
# Public domain.  Originally written 2009, Norbert Preining.
# 
# update the master message.pot catalog and merge the result into the
# respective .po files.

# Convenience variables.
mydir=`dirname $0`
Master=`cd $mydir/../.. && pwd`
transdir=$Master/tlpkg/translations

cd $Master || exit 1
cp $transdir/messages.pot $transdir/messages.prev
xgettext -o tlpkg/translations/messages.pot  -L Perl   \
	--copyright-holder="TeX Live Team"	\
	--package-name="TeX Live"		\
	--package-version=2009			\
	--msgid-bugs-address=tex-live@tug.org	\
       -k__ -k\$__ -k%__ -k__x -k__n:1,2 -k__nx:1,2 -k__xn:1,2 -kN__ -k  \
       tlpkg/installer/install-menu-perltk.pl \
       tlpkg/installer/install-menu-wizard.pl \
       texmf/scripts/texlive/tlmgrgui/*.pl

cd $transdir || exit 1

tmpa=`mktemp`
tmpb=`mktemp`
sed /POT-Creation-Date:/d <messages.prev >$tmpa
sed /POT-Creation-Date:/d <messages.pot >$tmpb
if cmp -s $tmpa $tmpb ; then
  echo "$0: no msg changes."
  mv messages.prev messages.pot
  rm -f $tmpa $tmpb
  exit 0
fi
rm -f $tmpa $tmpb messages.prev

# here we come only if there have been changes
for i in *.po ; do
  printf "$i "
  msgmerge --backup=none --update $i messages.pot
done

exit $?