]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - tx.sh
DarkPlaces and GMQCC are names, not translatable
[xonotic/xonotic-data.pk3dir.git] / tx.sh
diff --git a/tx.sh b/tx.sh
index 212a036fcb08d459ba4db7eb5d1b251065d8e665..2fefa8fa48e4be7fcbe736259e4ac447648732b4 100644 (file)
--- a/tx.sh
+++ b/tx.sh
@@ -7,6 +7,9 @@ mergebase=`git log --pretty=oneline -1 .tx/merge-base | cut -d ' ' -f 1`
 
 set -e
 
+# Update the .pot.
+sh check-translations.sh pot
+
 # First upload our current .pot.
 mkdir -p translations/xonotic.commonpot/
 cp common.pot translations/xonotic.commonpot/en..po
@@ -18,35 +21,37 @@ tx pull -f -a
 for f in common.*.po; do
        lang=${f%.po}
        lang=${lang#common.}
+       case "$lang" in
+               de_CH)
+                       continue
+                       ;;
+       esac
        tcurfile=translations/xonotic.commonpot/$lang..po
        goldfile=translations/xonotic.commonpot/$lang..po.orig
        gnewfile=common.$lang.po
        if [ -f "$tcurfile" ]; then
                git show "$mergebase":"$gnewfile" > "$goldfile"
-               msgcat -s --no-location --strict "$tcurfile" | grep -v "^#" > "$tcurfile.sorted"
-               msgcat -s --no-location --strict "$goldfile" | grep -v "^#" > "$goldfile.sorted"
-               msgcat -s --no-location --strict "$gnewfile" | grep -v "^#" > "$gnewfile.sorted"
-               if diff -u "$goldfile.sorted" "$gnewfile.sorted" >/dev/null; then
+               msgmerge -F -U "$tcurfile" common.pot
+               msgmerge -F -U "$goldfile" common.pot
+               msgmerge -F -U "$gnewfile" common.pot
+               if diff -u "$goldfile" "$gnewfile" >/dev/null; then
                        # no change on git, changed on tx only
                        msgmerge -F -U "$tcurfile" common.pot
                        cp "$tcurfile" "$gnewfile"
                else
-                       if ! diff -u "$goldfile.sorted" "$gnewfile.sorted" | patch "$tcurfile.sorted"; then
+                       if ! diff -u "$goldfile" "$gnewfile" | patch "$tcurfile"; then
                                while :; do
-                                       vim -o "$tcurfile.sorted.rej" "$tcurfile.sorted"
+                                       vim -o "$tcurfile.rej" "$tcurfile"
                                        echo "OK?"
                                        read -r OK || exit 1
                                        [ x"$OK" != x"y" ] || break
                                done
-                               rm -f "$tcurfile.sorted.rej"
+                               rm -f "$tcurfile.rej"
                        fi
-                       mv "$tcurfile.sorted" "$tcurfile"
                        msgmerge -F -U "$tcurfile" common.pot
                        cp "$tcurfile" "$gnewfile"
-                       rm "$goldfile.sorted"
-                       rm "$gnewfile.sorted"
-                       rm "$goldfile"
                fi
+               rm "$goldfile"
        else
                msgmerge -F -U "$gnewfile" common.pot
                cp "$gnewfile" "$tcurfile"
@@ -64,5 +69,23 @@ for f in translations/xonotic.commonpot/*..po; do
                cp "$tcurfile" "$gnewfile"
        fi
 done
-tx push -t
+tx push -t --skip
 date > .tx/merge-base
+
+# Generate Swiss Standard German from German.
+msgfilter -i common.de.po -o common.de_CH.po perl -pe '
+       # Character filters go here.
+       s/ß/ss/g;
+       # Word filters go here. By default we match even inside words, as there
+       # are constructs like ^BGflag where "flag" is the actual word. Make
+       # sure to not commit the clbuttical mistake.
+       s/eventuell/allfällig/g;
+'
+
+# Build new languages list.
+sh check-translations.sh txt > languages.txt.new
+mv languages.txt.new languages.txt
+
+# Report stats.
+git diff --stat
+git diff --color-words languages.txt