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
67 vim -o "$tcurfile.rej" "$tcurfile"
70 [ x"$OK" != x"y" ] || break
74 msgmerge -N -F -U "$tcurfile" common.pot
75 cp "$tcurfile" "$gnewfile"
79 msgmerge -N -F -U "$gnewfile" common.pot
80 cp "$gnewfile" "$tcurfile"
83 for f in translations/xonotic.commonpot/*..po; do
85 lang=${lang#translations/xonotic.commonpot/}
86 [ x"$lang" != x"en" ] || continue
87 tcurfile=translations/xonotic.commonpot/$lang..po
88 gnewfile=common.$lang.po
89 if ! [ -f "$gnewfile" ]; then
92 cp "$tcurfile" "$gnewfile"
98 # Generate Swiss Standard German from German.
99 msgfilter -i common.de.po -o common.de_CH.po perl -pe '
100 # Character filters go here.
102 # Word filters go here. By default we match even inside words, as there
103 # are constructs like ^BGflag where "flag" is the actual word. Make
104 # sure to not commit the clbuttical mistake.
105 s/eventuell/allfällig/g;
108 # Build new languages list.
109 sh check-translations.sh txt > languages.txt.new
110 mv languages.txt.new languages.txt
114 git diff --color-words languages.txt