cvs: phpdoc /scripts check-trans.php

From: Date: Sat, 28 Jun 2008 16:39:28 +0000
Subject: cvs: phpdoc /scripts check-trans.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1804@lists.php.net to get a copy of this message
yannick Sat Jun 28 16:39:28 2008 UTC Modified files: /phpdoc/scripts check-trans.php Log: Add new check : check number of literal tags http://cvs.php.net/viewvc.cgi/phpdoc/scripts/check-trans.php?r1=1.12&r2=1.13&diff_format=u Index: phpdoc/scripts/check-trans.php diff -u phpdoc/scripts/check-trans.php:1.12 phpdoc/scripts/check-trans.php:1.13 --- phpdoc/scripts/check-trans.php:1.12 Sun Jun 8 09:09:54 2008 +++ phpdoc/scripts/check-trans.php Sat Jun 28 16:39:27 2008 @@ -78,6 +78,7 @@ $nb_error['classsynopsis'] = 0; $nb_error['table'] = 0; $nb_error['para'] = 0; +$nb_error['literal'] = 0; function do_check($en_content, $lang_content) { @@ -944,7 +945,7 @@ 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.", + "libel" => "Error in para tag : $en_para tag <para> in EN, and $lang_para in $LANG.", "value_en" => "N/A", "value_lang" => "N/A" ); @@ -953,6 +954,29 @@ // END : para +// literal + +$en_literal = 0; +preg_match_all("/<literal>/s", $en_content, $match2); +$en_literal = count($match2[0]); + + +$lang_literal = 0; +preg_match_all("/<literal>/s", $lang_content, $match2); +$lang_literal = count($match2[0]); + + + if( $en_literal != $lang_literal ) { + $nb_error['literal'] ++; + $result_error[] = array( + "libel" => "Error in literal tag : $en_literal tag <literal> in EN, and $lang_literal in $LANG.", + "value_en" => "N/A", + "value_lang" => "N/A" + ); + + } + +// END : literal return $result_error; } // do_check @@ -1278,6 +1302,10 @@ <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> + <td><strong>literal</strong><br /><em>Check number of literal tag.</em></td> + <td>'.(($nb_error['literal'] == 0)?'-':'<strong>'.$nb_error['literal'].'</strong>').'</td> +</tr> <tr class="crit"> <td class="r">Total :<br/>In '.$nb_file.' file(s)</td>

« previous php.doc.cvs (#1804) next »