4 # .tx/merge-base - changed whenever translations get merged
6 mergebase=`git log --pretty=oneline -1 .tx/merge-base | cut -d ' ' -f 1`
10 # First upload our current .pot.
11 mkdir -p translations/xonotic.commonpot/
12 cp common.pot translations/xonotic.commonpot/en..po
18 for f in common.*.po; do
21 tcurfile=translations/xonotic.commonpot/$lang..po
22 goldfile=translations/xonotic.commonpot/$lang..po.orig
23 gnewfile=common.$lang.po
24 if [ -f "$tcurfile" ]; then
25 git show "$mergebase":"$gnewfile" > "$goldfile"
26 msgcat -s --no-location --strict "$tcurfile" | grep -v "^#" > "$tcurfile.sorted"
27 msgcat -s --no-location --strict "$goldfile" | grep -v "^#" > "$goldfile.sorted"
28 msgcat -s --no-location --strict "$gnewfile" | grep -v "^#" > "$gnewfile.sorted"
29 if diff -u "$goldfile.sorted" "$gnewfile.sorted" >/dev/null; then
30 # no change on git, changed on tx only
31 msgmerge -F -U "$tcurfile" common.pot
32 cp "$tcurfile" "$gnewfile"
34 if ! diff -u "$goldfile.sorted" "$gnewfile.sorted" | patch "$tcurfile.sorted"; then
36 vim -o "$tcurfile.sorted.rej" "$tcurfile.sorted"
39 [ x"$OK" != x"y" ] || break
41 rm -f "$tcurfile.sorted.rej"
43 mv "$tcurfile.sorted" "$tcurfile"
44 msgmerge -F -U "$tcurfile" common.pot
45 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"