[Xfce4-commits] <www:master> Also update po files.

Nick Schermer noreply at xfce.org
Sat Apr 14 14:38:01 CEST 2012


Updating branch refs/heads/master
         to 3bc79e5c368cd9acde8bf277952679bbeaf005e8 (commit)
       from dbd043e466e26e9a11fc2a979fc715af09e29e9d (commit)

commit 3bc79e5c368cd9acde8bf277952679bbeaf005e8
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Apr 14 14:35:55 2012 +0200

    Also update po files.

 lib/tools/updatepot.sh |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/lib/tools/updatepot.sh b/lib/tools/updatepot.sh
index 2a3c65f..4ad1767 100755
--- a/lib/tools/updatepot.sh
+++ b/lib/tools/updatepot.sh
@@ -8,3 +8,30 @@ files=$(find $pagespath -name "*.php" -printf "%P ")
 xgettext -kR_ -kE_ -L php --package-name www.xfce.org --from-code=UTF-8 \
         --msgid-bugs-address https://bugzilla.xfce.org -o $potfile -D $pagespath $files
 sed -e 's/charset=CHARSET/charset=UTF-8/' -i $potfile
+
+# Regenerate the po files
+cd ../po
+for file in $(echo *.po);
+do
+  lang=${file%.po}
+  echo $lang
+  result=`msgmerge -o $lang.new.po $lang.po www.pot`
+  if $result; then
+    if cmp $lang.po $lang.new.po >/dev/null 2>&1;
+    then
+      rm -f $lang.new.po
+    else 
+      if mv -f $lang.new.po $lang.po;
+      then
+        :;
+      else
+        echo "msgmerge for $lang.po failed: cannot move $lang.new.po to $lang.po" 1>&2;
+        rm -f $lang.new.po;
+        exit 1;
+      fi;
+    fi;
+  else
+    echo "msgmerge for $lang.gmo failed!";
+    rm -f $lang.new.po;
+  fi
+done


More information about the Xfce4-commits mailing list