2 /* vim: set expandtab sw=4 ts=4 sts=4 ft=php: */
4 * Script to parse advisor rules and output them as PHP code which can be used
5 * by gettext for generating po(t) files.
8 if (!file_exists('./libraries/Advisor.class.php')) {
11 include './libraries/Advisor.class.php';
13 $rules = Advisor::parseRulesFile();
16 echo "/* DO NOT EDIT! */\n";
17 echo "/* This is automatically generated file from libraries/advisory_rules.txt */\n";
19 foreach($rules['rules'] as $rule) {
21 echo "printf(__('" . addcslashes(Advisor::escapePercent($rule['name']), "'\\") . "'));\n";
22 echo "printf(__('" . addcslashes(Advisor::escapePercent($rule['issue']), "'\\") . "'));\n";
23 echo "printf(__('" . addcslashes(Advisor::escapePercent($rule['recommendation']), "'\\") . "'));\n";
24 $jst = Advisor::splitJustification($rule);
25 echo "printf(__('" . addcslashes(Advisor::escapePercent($jst[0]), "'\\") . "'));\n";