Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Čihař <mcihar@suse.cz>2011-08-11 15:48:07 +0400
committerMichal Čihař <mcihar@suse.cz>2011-08-11 15:48:07 +0400
commit7166723120a259dc9bd6a0ec6dfdd372c268f86b (patch)
tree00f34c28bd214903261d3758c25318e3ab33558d /scripts
parentf81cf3fc42cbbed46465a639c15ce2256ef2f1ab (diff)
Update po generating scripts to include advisor rules
Diffstat (limited to 'scripts')
-rw-r--r--scripts/advisor2php13
-rwxr-xr-xscripts/update-po9
2 files changed, 17 insertions, 5 deletions
diff --git a/scripts/advisor2php b/scripts/advisor2php
index 5607f6e84d..28a58176fe 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 a12e59890b..9131980be1 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@.*/\(.*\)\.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/;