Translated using Weblate (Hindi)
[phpmyadmin.git] / scripts / update-po
blobfdeebaa12968659261e0942d46621a70fee14ea9
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 # Generate Twig template cache in clean dir
15 rm -rf twig-templates/
16 php ./scripts/generate-twig-cache
18 # Update pot (template), ensure that advisor is at the end
19 LOCS=`ls po/*.po | sed 's@.*/\(.*\)\.po@\1@'`
20 xgettext \
21 -d phpmyadmin \
22 --msgid-bugs-address=translators@phpmyadmin.net \
23 -o po/phpmyadmin.pot \
24 --language=PHP \
25 --add-comments=l10n \
26 --add-location \
27 --debug \
28 --from-code=utf-8 \
29 --keyword=__ --keyword=_gettext --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
30 --copyright-holder="phpMyAdmin devel team" \
31 `find \( -name '*.php' -o -name '*.phtml' \) -not -path './test/*' -not -path './po/*' -not -path './tmp/*' -not -path './release/*' -not -path './vendor/*' | sort`
33 # Fixup filenames for Twig templates
34 php scripts/fix-po-twig
36 # Remote twig templates
37 rm -rf twig-templates/
39 # Generate PHP code for advisor rules
40 php ./scripts/advisor2po >> po/phpmyadmin.pot
42 ver=`sed -n "/PMA_VERSION', '/ s/.*PMA_VERSION', '\(.*\)'.*/\1/p" libraries/classes/Config.php`
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 ' po/phpmyadmin.pot
51 # Update po files (translations)
52 for loc in $LOCS ; do
53 sed -i '
54 s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
55 s/PACKAGE/phpMyAdmin/;
56 s/(C) YEAR/(C) 2003 - '`date +%Y`'/;
57 s/VERSION/'$ver'/;
58 s/Project-Id-Version: phpMyAdmin .*/Project-Id-Version: phpMyAdmin '$ver'\\n"/;
59 ' po/$loc.po
60 msgmerge --previous -U po/$loc.po po/phpmyadmin.pot
61 done
63 # Commit changes
64 git add po/*.po po/phpmyadmin.pot
65 git commit -s -m 'Update po files
67 [CI skip]'