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:
authorPiotr Przybylski <piotrprz@gmail.com>2011-08-13 00:02:40 +0400
committerPiotr Przybylski <piotrprz@gmail.com>2011-08-13 00:02:40 +0400
commita7c0c55c7fa9c0ee45cef59245e2572f3c2f1be1 (patch)
tree5796d8d201939016ef01bacc626f517e10f56795 /scripts
parent64926ead73dadd10b323712304d72fa86c6a3982 (diff)
parent9147f30dc6b00dc63c998f1d2d3972d1a47e6c57 (diff)
Merge remote-tracking branch 'origin/master' into drizzle
Conflicts: js/server_status.js libraries/common.lib.php tbl_printview.php tbl_select.php tbl_structure.php
Diffstat (limited to 'scripts')
-rw-r--r--scripts/advisor2php33
-rw-r--r--scripts/create_tables.sql1
-rwxr-xr-xscripts/update-po9
3 files changed, 42 insertions, 1 deletions
diff --git a/scripts/advisor2php b/scripts/advisor2php
new file mode 100644
index 0000000000..28a58176fe
--- /dev/null
+++ b/scripts/advisor2php
@@ -0,0 +1,33 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4 ft=php: */
+/**
+ * Script to parse advisor rules and output them as PHP code which can be used
+ * by gettext for generating po(t) files.
+ */
+
+if (!file_exists('./libraries/advisor.class.php')) {
+ chdir('..');
+}
+include './libraries/advisor.class.php';
+
+$rules = Advisor::parseRulesFile();
+
+echo "<?php\n";
+echo "/* DO NOT EDIT! */\n";
+echo "/* This is automatically generated file from libraries/advisory_rules.txt */\n";
+
+foreach($rules['rules'] as $rule) {
+ echo "\n";
+ echo "echo __('" . addslashes($rule['name']) . "');\n";
+ echo "echo __('" . addslashes($rule['issue']) . "');\n";
+ echo "echo __('" . addslashes($rule['recommendation']) . "');\n";
+ $jst = Advisor::splitJustification($rule);
+ 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/create_tables.sql b/scripts/create_tables.sql
index 5db0de4e70..b0a52201fe 100644
--- a/scripts/create_tables.sql
+++ b/scripts/create_tables.sql
@@ -128,6 +128,7 @@ CREATE TABLE IF NOT EXISTS `pma_table_uiprefs` (
`db_name` varchar(64) NOT NULL,
`table_name` varchar(64) NOT NULL,
`prefs` text NOT NULL,
+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`username`,`db_name`,`table_name`)
)
ENGINE=MyISAM COMMENT='Tables'' UI preferences'
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/;