diff options
author | Michal Čihař <michal@cihar.com> | 2016-03-01 16:19:35 +0100 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2016-12-21 15:02:37 +0100 |
commit | cbbcad1ae95c8628860060d8de7b616ab0022a68 (patch) | |
tree | fdba287c67d6f08f40ecd109de780fb8468a42e0 | |
parent | 865eb2ec94d0df05adacf06e540eaf6b03daf6ed (diff) | |
download | sql-parser-cbbcad1ae95c8628860060d8de7b616ab0022a68.zip sql-parser-cbbcad1ae95c8628860060d8de7b616ab0022a68.tar.gz sql-parser-cbbcad1ae95c8628860060d8de7b616ab0022a68.tar.bz2 |
Add script for extracting strings to po files
Signed-off-by: Michal Čihař <michal@cihar.com>
-rwxr-xr-x | scripts/update-po | 48 |
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]' |