summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/po/gen-po.in
blob: 78ef93dc0b1f98ae44ae8d47b68b50c283c7d626 (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
#!/bin/sh

top_srcdir=@top_srcdir@
name="@PACKAGE_NAME@"
version="@PACKAGE_VERSION@"

domain=$1
shift

outdir=${top_srcdir}/po/${domain}
outfile=${outdir}/${domain}.pot

test -d $outdir || mkdir $outdir

xgettext \
    --package-name="${name}" \
    --package-version="${version}" \
    --foreign-user \
    --default-domain=${domain} \
    --add-comments \
    --keyword=N_ \
    --keyword=NP_ \
    -o ${outfile}.new \
    "$@"

test -f ${outfile}.new && \
    perl -pi -e "s@${top_srcdir}/@@" ${outfile}.new

grep -v "POT-Creation-Date:" ${outfile}.new > ${outfile}.new2
grep -v "POT-Creation-Date:" ${outfile} > ${outfile}.old

if ! diff ${outfile}.old ${outfile}.new2 >/dev/null; then
    echo "${outfile} changed"
    cp ${outfile}.new ${outfile}
fi
rm ${outfile}.new* ${outfile}.old

exit 0