4 # .tx/merge-base - changed whenever translations get merged
6 mergebase=`git log --pretty=oneline -1 .tx/merge-base | cut -d ' ' -f 1`
11 sh check-translations.sh pot
13 # First upload our current .pot.
14 mkdir -p translations/xonotic.commonpot/
15 cp common.pot translations/xonotic.commonpot/en..po
21 for f in common.*.po; do
24 tcurfile=translations/xonotic.commonpot/$lang..po
25 goldfile=translations/xonotic.commonpot/$lang..po.orig
26 gnewfile=common.$lang.po
27 if [ -f "$tcurfile" ]; then
28 git show "$mergebase":"$gnewfile" > "$goldfile"
29 msgmerge -F -U "$tcurfile" common.pot
30 msgmerge -F -U "$goldfile" common.pot
31 msgmerge -F -U "$gnewfile" common.pot
32 if diff -u "$goldfile" "$gnewfile" >/dev/null; then
33 # no change on git, changed on tx only
34 msgmerge -F -U "$tcurfile" common.pot
35 cp "$tcurfile" "$gnewfile"
37 if ! diff -u "$goldfile" "$gnewfile" | patch "$tcurfile"; then
39 vim -o "$tcurfile.rej" "$tcurfile"
42 [ x"$OK" != x"y" ] || break
46 msgmerge -F -U "$tcurfile" common.pot
47 cp "$tcurfile" "$gnewfile"
51 msgmerge -F -U "$gnewfile" common.pot
52 cp "$gnewfile" "$tcurfile"
55 for f in translations/xonotic.commonpot/*..po; do
57 lang=${lang#translations/xonotic.commonpot/}
58 [ x"$lang" != x"en" ] || continue
59 tcurfile=translations/xonotic.commonpot/$lang..po
60 gnewfile=common.$lang.po
61 if ! [ -f "$gnewfile" ]; then
64 cp "$tcurfile" "$gnewfile"
70 # Build new languages list.
71 sh check-translations.sh txt > languages.txt.new
72 mv languages.txt.new languages.txt
76 git diff --color-words languages.txt