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