Paul Vriens : transl: Write more information to the lang and summary files.

Alexandre Julliard julliard at winehq.org
Wed Aug 12 11:01:25 CDT 2009


Module: tools
Branch: master
Commit: 7e64d9bf346771fd0aefb5e657beeb697f71061a
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=7e64d9bf346771fd0aefb5e657beeb697f71061a

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Tue Aug 11 10:30:01 2009 +0200

transl: Write more information to the lang and summary files.

---

 transl/php/lang.php               |    2 +-
 transl/scripts/parse_resfiles.php |   25 +++++++++++++++++++++----
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/transl/php/lang.php b/transl/php/lang.php
index 304783d..91aee9d 100644
--- a/transl/php/lang.php
+++ b/transl/php/lang.php
@@ -19,7 +19,7 @@ function parse_file($lang)
     $curr_file = "";
     while ($line = fgets($file, 4096))
     {
-        if (preg_match("/FILE ([A-Z]+) (.*) ([0-9]+) ([0-9]+) ([0-9]+)/", $line, $m))
+        if (preg_match("/FILE ([A-Z]+) (.*) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)/", $line, $m))
         {
             $curr_file = $m[2];
             if ($m[1] == "NONE")
diff --git a/transl/scripts/parse_resfiles.php b/transl/scripts/parse_resfiles.php
index b1d8b82..41ed364 100644
--- a/transl/scripts/parse_resfiles.php
+++ b/transl/scripts/parse_resfiles.php
@@ -285,7 +285,7 @@ foreach (array_keys($checks) as $dir)
         if (!isset($file_langs[$lang]) && !isset($file_langs[$basic_lang]))
         {
             $langout = fopen("$workdir/$lang", "a+");
-            fwrite($langout, "FILE NONE $dir 0 $mastercount 0\n");
+            fwrite($langout, "FILE NONE $dir 0 $mastercount 0 0 0 0\n");
             fclose($langout);
             continue;
         }
@@ -293,7 +293,9 @@ foreach (array_keys($checks) as $dir)
         $translated = 0;
         $missing = 0;
         $errors = 0;
+        $total_errors = 0;
         $warnings = 0;
+        $total_warnings = 0;
 
         $errors_rl = array();
         $missing_rl = array();
@@ -328,6 +330,9 @@ foreach (array_keys($checks) as $dir)
                                       ": Translation inherited from @LANG($basic_lang)";
                         $translated++;
                     }
+
+                    if ($res_warnings)
+                        $warnings++;
                 }
             }
             else
@@ -347,11 +352,17 @@ foreach (array_keys($checks) as $dir)
                                   ": Resource translated";
                     $translated++;
                 }
+
+                if ($res_warnings)
+                    $warnings++;
             }
+
+            $total_errors += $res_errors;
+            $total_warnings += $res_warnings;
         }
 
         $langout = fopen("$workdir/$lang", "a+");
-        fwrite($langout, "FILE STAT $dir $translated $missing $errors\n");
+        fwrite($langout, "FILE STAT $dir $translated $missing $errors $total_errors $warnings $total_warnings\n");
         foreach ($errors_rl as $msg)
             fwrite($langout, "$msg\n");
         foreach ($missing_rl as $msg)
@@ -369,19 +380,25 @@ foreach ($languages as $lang)
     $transl = 0;
     $missing = 0;
     $errors = 0;
+    $total_errors = 0;
+    $warnings = 0;
+    $total_warnings = 0;
     $file = fopen("$workdir/$lang", "r");
     while ($line = fgets($file, 4096))
     {
-        if (preg_match("/^FILE [A-Z]+ .* ([0-9]+) ([0-9]+) ([0-9]+)$/", $line, $m))
+        if (preg_match("/^FILE [A-Z]+ .* ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)$/", $line, $m))
         {
             $transl += $m[1];
             $missing += $m[2];
             $errors += $m[3];
+            $total_errors += $m[4];
+            $warnings += $m[5];
+            $total_warnings += $m[6];
         }
     }
     fclose($file);
     $sum = $transl + $missing + $errors;
-    fwrite($summary, "LANG $lang $sum $transl $missing $errors\n");
+    fwrite($summary, "LANG $lang $sum $transl $missing $errors $total_errors $warnings $total_warnings\n");
 }
 fclose($summary);
 ?>




More information about the wine-cvs mailing list