Merge branch 'QA_3_5'
[phpmyadmin.git] / scripts / update-po
blob9131980be19d71fb64673410548e0e98fb5f05cc
1 #!/bin/sh
2 # vim: expandtab sw=4 ts=4 sts=4:
3 export LC_ALL=C
5 # Generate PHP code for advisor rules
6 php ./scripts/advisor2php > po/advisory_rules.php
8 # Update pot (template), ensure that advisor is at the end
9 LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'`
10 xgettext \
11 -d phpmyadmin \
12 --msgid-bugs-address=phpmyadmin-devel@lists.sourceforge.net \
13 -o po/phpmyadmin.pot \
14 --language=PHP \
15 --add-comments=l10n \
16 --add-location \
17 --debug \
18 --keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
19 --copyright-holder="phpMyAdmin devel team" \
20 `find . -name '*.php' -not -path './test/*' -not -path './po/*' | sort` \
21 po/advisory_rules.php
23 ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/Config.class.php`
25 sed -i '
26 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
27 s/PACKAGE/phpMyAdmin/;
28 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
29 s/VERSION/'$ver'/;
30 ' po/phpmyadmin.pot
32 # Update po files (translations)
33 for loc in $LOCS ; do
34 sed -i '
35 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
36 s/PACKAGE/phpMyAdmin/;
37 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
38 s/VERSION/'$ver'/;
39 s/Project-Id-Version: phpMyAdmin .*/Project-Id-Version: phpMyAdmin '$ver'\\n"/;
40 ' po/$loc.po
41 if [ -f ../localized_docs/po/$loc.po ] ; then
42 msgmerge --previous -C ../localized_docs/po/$loc.po -U po/$loc.po po/phpmyadmin.pot
43 else
44 msgmerge --previous -U po/$loc.po po/phpmyadmin.pot
46 done