[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-14425-g7166723
Michal Čihař
nijel at users.sourceforge.net
Thu Aug 11 13:48:40 CEST 2011
The branch, master has been updated
via 7166723120a259dc9bd6a0ec6dfdd372c268f86b (commit)
from f81cf3fc42cbbed46465a639c15ce2256ef2f1ab (commit)
- Log -----------------------------------------------------------------
commit 7166723120a259dc9bd6a0ec6dfdd372c268f86b
Author: Michal Čihař <mcihar at suse.cz>
Date: Thu Aug 11 13:48:07 2011 +0200
Update po generating scripts to include advisor rules
-----------------------------------------------------------------------
Summary of changes:
scripts/advisor2php | 13 +++++++++----
scripts/update-po | 9 ++++++++-
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/scripts/advisor2php b/scripts/advisor2php
index 5607f6e..28a5817 100644
--- a/scripts/advisor2php
+++ b/scripts/advisor2php
@@ -18,11 +18,16 @@ echo "/* This is automatically generated file from libraries/advisory_rules.txt
foreach($rules['rules'] as $rule) {
echo "\n";
- echo "echo __('" . $rule['name'] . "');\n";
- echo "echo __('" . $rule['issue'] . "');\n";
- echo "echo __('" . $rule['recommendation'] . "');\n";
+ echo "echo __('" . addslashes($rule['name']) . "');\n";
+ echo "echo __('" . addslashes($rule['issue']) . "');\n";
+ echo "echo __('" . addslashes($rule['recommendation']) . "');\n";
$jst = Advisor::splitJustification($rule);
- echo "echo __('" . $jst[0] . "');\n";
+ if (count($jst) > 1) {
+ /* printf is used here just to ensure proper type of string */
+ echo "printf(__('" . addslashes($jst[0]) . "'), 0);\n";
+ } else {
+ echo "echo __('" . addslashes($jst[0]) . "');\n";
+ }
}
?>
diff --git a/scripts/update-po b/scripts/update-po
index a12e598..9131980 100755
--- a/scripts/update-po
+++ b/scripts/update-po
@@ -1,6 +1,11 @@
#!/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 at .*/\(.*\)\.po@\1@'`
xgettext \
-d phpmyadmin \
@@ -12,7 +17,8 @@ xgettext \
--debug \
--keyword=__ --keyword=_pgettext:1c,2 --keyword=_ngettext:1,2 \
--copyright-holder="phpMyAdmin devel team" \
- `find . -name '*.php' -not -path './test/*' | sort`
+ `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`
@@ -23,6 +29,7 @@ sed -i '
s/VERSION/'$ver'/;
' po/phpmyadmin.pot
+# Update po files (translations)
for loc in $LOCS ; do
sed -i '
s/SOME DESCRIPTIVE TITLE/phpMyAdmin translation/;
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list