cvs: phpdoc /scripts check-trans.php
| From: | Yannick Torres | Date: | Fri, 11 Apr 2008 17:15:18 +0000 |
| Subject: | cvs: phpdoc /scripts check-trans.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1471@lists.php.net to get a copy of this message | ||
yannick Fri Apr 11 17:15:18 2008 UTC
Modified files:
/phpdoc/scripts check-trans.php
Log:
2 news rules :
- Check number of rows in table tag.
- Check number of para tag
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/check-trans.php?r1=1.5&r2=1.6&diff_format=u
Index: phpdoc/scripts/check-trans.php
diff -u phpdoc/scripts/check-trans.php:1.5 phpdoc/scripts/check-trans.php:1.6
--- phpdoc/scripts/check-trans.php:1.5 Fri Apr 11 17:09:17 2008
+++ phpdoc/scripts/check-trans.php Fri Apr 11 17:15:18 2008
@@ -76,6 +76,8 @@
$nb_error['seealsoMember'] = 0;
$nb_error['cdata'] = 0;
$nb_error['classsynopsis'] = 0;
+$nb_error['table'] = 0;
+$nb_error['para'] = 0;
function do_check($en_content, $lang_content) {
@@ -891,6 +893,65 @@
// END : classsynopsis
+// table
+
+$en_table = array();
+preg_match_all("/<table(.*?)<\/table>/s", $en_content, $match2);
+$en_table = $match2[1];
+
+$lang_table = array();
+preg_match_all("/<table(.*?)<\/table>/s", $lang_content, $match2);
+$lang_table = $match2[1];
+
+for( $i=0; $i < count($en_table); $i++) {
+
+preg_match_all("/<row>(.*?)<\/row>/s", $en_table[$i], $match3);
+preg_match_all("/<row>(.*?)<\/row>/s", $lang_table[$i], $match4);
+
+$nb_en = count($match3[1]);
+$nb_lang = count($match4[1]);
+
+if( $nb_en != $nb_lang ) {
+ $nb_error['table'] ++;
+ $result_error[] = array(
+ "libel" => "Error in table listing : $nb_en row(s) in EN, and $nb_lang
in $LANG.",
+ "value_en" => "N/A",
+ "value_lang" => "N/A"
+ );
+
+}
+
+}
+
+// END : table
+
+
+
+// para
+
+$en_para = 0;
+preg_match_all("/<para(.*?)<\/para>/s", $en_content, $match2);
+$en_para = count($match2[1]);
+
+
+$lang_para = 0;
+preg_match_all("/<para(.*?)<\/para>/s", $lang_content, $match2);
+$lang_para = count($match2[1]);
+
+
+ if( $en_para != $lang_para ) {
+ $nb_error['para'] ++;
+ $result_error[] = array(
+ "libel" => "Error about para tag : $en_para tag <para> in EN, and
$lang_para in $LANG.",
+ "value_en" => "N/A",
+ "value_lang" => "N/A"
+ );
+
+ }
+
+// END : para
+
+
return $result_error;
} // do_check
@@ -1070,7 +1131,6 @@
}
-
$html = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
@@ -1205,6 +1265,19 @@
<td><strong>classsynopsis</strong><br /><em>Check
"classsynopsis" tag & attribut consistency.</em></td>
<td>'.(($nb_error['classsynopsis'] ==
0)?'-':'<strong>'.$nb_error['classsynopsis'].'</strong>').'</td>
</tr>
+
+
+
+
+<tr>
+ <td><strong>row in Table</strong><br /><em>Check number of rows in
table tag.</em></td>
+ <td>'.(($nb_error['table'] ==
0)?'-':'<strong>'.$nb_error['table'].'</strong>').'</td>
+</tr>
+<tr class="old">
+ <td><strong>para</strong><br /><em>Check number of para
tag.</em></td>
+ <td>'.(($nb_error['para'] ==
0)?'-':'<strong>'.$nb_error['para'].'</strong>').'</td>
+</tr>
+
<tr class="crit">
<td class="r">Total :<br/>In '.$nb_file.' file(s)</td>
<td class="b c">'.$nb_error_all.'</td>