4 # .tx/merge-base - changed whenever translations get merged
6 mergebase=`git log --pretty=oneline -1 .tx/merge-base | cut -d ' ' -f 1`
25 echo "Usage: $0 [all|pot|po]"
32 sh check-translations.sh pot
34 # First upload our current .pot.
35 mkdir -p translations/xonotic.commonpot/
36 cp common.pot translations/xonotic.commonpot/en..po
44 for f in common.*.po; do
52 tcurfile=translations/xonotic.commonpot/$lang..po
53 goldfile=translations/xonotic.commonpot/$lang..po.orig
54 gnewfile=common.$lang.po
55 if [ -f "$tcurfile" ]; then
56 git show "$mergebase":"$gnewfile" > "$goldfile"
57 msgmerge -N -F -U "$tcurfile" common.pot
58 msgmerge -N -F -U "$goldfile" common.pot
59 msgmerge -N -F -U "$gnewfile" common.pot
60 if diff -u "$goldfile" "$gnewfile" >/dev/null; then
61 # no change on git, changed on tx only
62 msgmerge -N -F -U "$tcurfile" common.pot
63 cp "$tcurfile" "$gnewfile"
65 if ! diff -u "$goldfile" "$gnewfile" | patch "$tcurfile"; then
66 if [ -z "$BATCH" ]; then
68 vim -o "$tcurfile.rej" "$tcurfile"
71 [ x"$OK" != x"y" ] || break
76 msgmerge -N -F -U "$tcurfile" common.pot
77 cp "$tcurfile" "$gnewfile"
81 msgmerge -N -F -U "$gnewfile" common.pot
82 cp "$gnewfile" "$tcurfile"
85 for f in translations/xonotic.commonpot/*..po; do
87 lang=${lang#translations/xonotic.commonpot/}
88 [ x"$lang" != x"en" ] || continue
89 tcurfile=translations/xonotic.commonpot/$lang..po
90 gnewfile=common.$lang.po
91 if ! [ -f "$gnewfile" ]; then
94 cp "$tcurfile" "$gnewfile"
100 # Generate Swiss Standard German from German.
101 msgfilter -i common.de.po -o common.de_CH.po perl -pe '
102 # Character filters go here.
104 # Word filters go here. By default we match even inside words, as there
105 # are constructs like ^BGflag where "flag" is the actual word. Make
106 # sure to not commit the clbuttical mistake.
107 s/eventuell/allfällig/g;
110 # Build new languages list.
111 sh check-translations.sh txt > languages.txt.new
112 mv languages.txt.new languages.txt
116 git diff --color-words languages.txt