Adjust tests to new attributes
[phpmyadmin.git] / scripts / update-po
blob315a1e58b3ff4a2559ac3b8b2d91cf21a93e8773
1 #!/bin/sh
2 # vim: expandtab sw=4 ts=4 sts=4:
3 export LC_ALL=C
5 # Do not run as CGI
6 if [ -n "$GATEWAY_INTERFACE" ] ; then
7 echo 'Can not invoke as CGI!'
8 exit 1
9 fi
11 # Exit on failure
12 set -e
14 # Update pot (template), ensure that advisor is at the end
15 LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'`
16 xgettext \
17 -d phpmyadmin \
18 --msgid-bugs-address=translators@phpmyadmin.net \
19 -o po/phpmyadmin.pot \
20 --language=PHP \
21 --add-comments=l10n \
22 --add-location \
23 --debug \
24 --from-code=utf-8 \
25 --keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
26 --copyright-holder="phpMyAdmin devel team" \
27 `find \( -name '*.php' -o -name '*.phtml' \) -not -path './test/*' -not -path './po/*' \( -not -path './release/*' -not -path './vendor/*' \) | sort`
30 # Generate PHP code for advisor rules
31 php ./scripts/advisor2po >> po/phpmyadmin.pot
33 ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/Config.php`
35 sed -i '
36 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
37 s/PACKAGE/phpMyAdmin/;
38 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
39 s/VERSION/'$ver'/;
40 ' po/phpmyadmin.pot
42 # Update po files (translations)
43 for loc in $LOCS ; do
44 sed -i '
45 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
46 s/PACKAGE/phpMyAdmin/;
47 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
48 s/VERSION/'$ver'/;
49 s/Project-Id-Version: phpMyAdmin .*/Project-Id-Version: phpMyAdmin '$ver'\\n"/;
50 ' po/$loc.po
51 msgmerge --previous -U po/$loc.po po/phpmyadmin.pot
52 done
54 # Commit changes
55 git add po/*.po po/phpmyadmin.pot
56 git commit -s -m 'Update po files
58 [CI skip]'