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
29 tcurfile=translations/xonotic.commonpot/$lang..po
30 goldfile=translations/xonotic.commonpot/$lang..po.orig
31 gnewfile=common.$lang.po
32 if [ -f "$tcurfile" ]; then
33 git show "$mergebase":"$gnewfile" > "$goldfile"
34 msgmerge -F -U "$tcurfile" common.pot
35 msgmerge -F -U "$goldfile" common.pot
36 msgmerge -F -U "$gnewfile" common.pot
37 if diff -u "$goldfile" "$gnewfile" >/dev/null; then
38 # no change on git, changed on tx only
39 msgmerge -F -U "$tcurfile" common.pot
40 cp "$tcurfile" "$gnewfile"
42 if ! diff -u "$goldfile" "$gnewfile" | patch "$tcurfile"; then
44 vim -o "$tcurfile.rej" "$tcurfile"
47 [ x"$OK" != x"y" ] || break
51 msgmerge -F -U "$tcurfile" common.pot
52 cp "$tcurfile" "$gnewfile"
56 msgmerge -F -U "$gnewfile" common.pot
57 cp "$gnewfile" "$tcurfile"
60 for f in translations/xonotic.commonpot/*..po; do
62 lang=${lang#translations/xonotic.commonpot/}
63 [ x"$lang" != x"en" ] || continue
64 tcurfile=translations/xonotic.commonpot/$lang..po
65 gnewfile=common.$lang.po
66 if ! [ -f "$gnewfile" ]; then
69 cp "$tcurfile" "$gnewfile"
75 # Generate Swiss Standard German from German.
76 msgfilter -i common.de.po -o common.de_CH.po perl -pe '
77 # Character filters go here.
79 # Word filters go here. By default we match even inside words, as there
80 # are constructs like ^BGflag where "flag" is the actual word. Make
81 # sure to not commit the clbuttical mistake.
82 s/eventuell/allfällig/g;
85 # Build new languages list.
86 sh check-translations.sh txt > languages.txt.new
87 mv languages.txt.new languages.txt
91 git diff --color-words languages.txt