summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/update-po48
1 files changed, 48 insertions, 0 deletions
diff --git a/scripts/update-po b/scripts/update-po
new file mode 100755
index 0000000..7612db3
--- /dev/null
+++ b/scripts/update-po
@@ -0,0 +1,48 @@
+#!/bin/sh
+# vim: expandtab sw=4 ts=4 sts=4:
+export LC_ALL=C
+
+# Exit on failure
+set -e
+
+# Update pot (template), ensure that advisor is at the end
+LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'`
+xgettext \
+ -d sqlparser \
+ --msgid-bugs-address=translators@phpmyadmin.net \
+ -o po/sqlparser.pot \
+ --language=PHP \
+ --add-comments=l10n \
+ --add-location \
+ --debug \
+ --from-code=utf-8 \
+ --keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
+ --copyright-holder="phpMyAdmin devel team" \
+ `find \( -name '*.php' -o -name '*.phtml' \) -not -path './test/*' -not -path './po/*' \( -not -path './release/*' -not -path './vendor/*' \) | sort`
+
+ver=0
+
+sed -i '
+ s/SOME DESCRIPTIVE TITLE/phpMyAdmin SQL parser translation/;
+ s/PACKAGE/SQL parser/;
+ s/(C) YEAR/(C) 2015 - '`date +%Y`'/;
+ s/VERSION/'$ver'/;
+ ' po/sqlparser.pot
+
+# Update po files (translations)
+for loc in $LOCS ; do
+ sed -i '
+ s/SOME DESCRIPTIVE TITLE/phpMyAdmin SQL parser translation/;
+ s/PACKAGE/SQL parser/;
+ s/(C) YEAR/(C) 2015 - '`date +%Y`'/;
+ s/VERSION/'$ver'/;
+ s/Project-Id-Version: \(phpMyAdmin\|SQL parser\) .*/Project-Id-Version: SQL parser '$ver'\\n"/;
+ ' po/$loc.po
+ msgmerge --previous -U po/$loc.po po/sqlparser.pot
+done
+
+# Commit changes
+git add po/*.po po/sqlparser.pot
+git commit -s -m 'Update po files
+
+[CI skip]'