Translated using Weblate (Italian)
[phpmyadmin.git] / scripts / update-po
blobdbc229efcaa9a870404aae9bed4b53a7beff1642
1 #!/bin/sh
2 # vim: expandtab sw=4 ts=4 sts=4:
3 export LC_ALL=C
5 # Exit on failure
6 set -e
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=developers@phpmyadmin.net \
13 -o po/phpmyadmin.pot \
14 --language=PHP \
15 --add-comments=l10n \
16 --add-location \
17 --debug \
18 --from-code=utf-8 \
19 --keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
20 --copyright-holder="phpMyAdmin devel team" \
21 `find -regex '.*\.\(php\|phtml\)$' -not -path './test/*' -not -path './po/*' -not -path './release/*' | sort`
23 # Generate PHP code for advisor rules
24 php ./scripts/advisor2po >> po/phpmyadmin.pot
26 ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/Config.class.php`
28 sed -i '
29 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
30 s/PACKAGE/phpMyAdmin/;
31 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
32 s/VERSION/'$ver'/;
33 ' po/phpmyadmin.pot
35 # Update po files (translations)
36 for loc in $LOCS ; do
37 sed -i '
38 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
39 s/PACKAGE/phpMyAdmin/;
40 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
41 s/VERSION/'$ver'/;
42 s/Project-Id-Version: phpMyAdmin .*/Project-Id-Version: phpMyAdmin '$ver'\\n"/;
43 ' po/$loc.po
44 msgmerge --previous -U po/$loc.po po/phpmyadmin.pot
45 done
47 # Commit changes
48 git add po/*.po po/phpmyadmin.pot
49 git commit -s -m 'Update po files
51 [CI skip]'