Author: mkrueger
Date: 2007-11-20 07:45:11 -0500 (Tue, 20 Nov 2007)
New Revision: 89971

Modified:
   trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog
   
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
   
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationService.cs
Log:
* MonoDevelop.Gettext/TranslationProject.cs: Process output is now
  written to the monitor.Log.

Modified: trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog
===================================================================
--- trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog      2007-11-20 
12:30:56 UTC (rev 89970)
+++ trunk/monodevelop/Extras/MonoDevelop.Gettext/ChangeLog      2007-11-20 
12:45:11 UTC (rev 89971)
@@ -1,5 +1,10 @@
 2007-11-20  Mike Krüger <[EMAIL PROTECTED]> 
 
+       * MonoDevelop.Gettext/TranslationProject.cs: Process output is now 
written
+         to the monitor.Log.
+
+2007-11-20  Mike Krüger <[EMAIL PROTECTED]> 
+
        * MonoDevelop.Gettext/TranslationProject.cs: gettext addin now only 
scans
          code files for translations.
 

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
      2007-11-20 12:30:56 UTC (rev 89970)
+++ 
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationProject.cs
      2007-11-20 12:45:11 UTC (rev 89971)
@@ -36,6 +36,7 @@
 using System.Xml;
 
 using MonoDevelop.Core;
+using MonoDevelop.Core.Execution;
 using MonoDevelop.Projects;
 using MonoDevelop.Projects.Serialization;
 using MonoDevelop.Gettext.Editor;
@@ -162,6 +163,8 @@
                                        Runtime.ProcessService.StartProcess 
("xgettext",
                                                                             
args.ToString (),
                                                                             
this.BaseDirectory,
+                                                                            
monitor.Log,
+                                                                            
monitor.Log,
                                                                             
delegate {
                                                if (File.Exists (this.tempFile))
                                                        File.Delete 
(this.tempFile);
@@ -260,20 +263,25 @@
                        args.Append ("--from-code=UTF-8");
                        args.Append (" -p ");args.Append ('"');args.Append 
(this.BaseDirectory);args.Append ('"');
                        args.Append (" -f ");args.Append ('"');args.Append 
(tempFile);args.Append ('"');
-                       System.Diagnostics.Process process = 
System.Diagnostics.Process.Start ("xgettext", args.ToString ());
-                       process.WaitForExit();
-                       MergeTranslations (this, null);
-                       monitor.EndTask ();
-               }
-               void MergeTranslations (object sender, EventArgs args)
-               {
+                       Runtime.ProcessService.StartProcess ("xgettext",
+                                                            args.ToString (),
+                                                            this.BaseDirectory,
+                                                            monitor.Log,
+                                                            monitor.Log,
+                                                            null).WaitForExit 
();
+                       
                        if (File.Exists (tempFile))
                                File.Delete (tempFile);
                        foreach (Translation translation in this.Translations) {
                                string poFileName  = GetFileName (translation);
-                               System.Diagnostics.Process process = 
System.Diagnostics.Process.Start ("msgmerge", " -U " + poFileName + "  " + 
this.BaseDirectory + "/messages.po");
-                               process.WaitForExit();
+                               Runtime.ProcessService.StartProcess ("msgmerge",
+                                                                    " -U " + 
poFileName + "  " + this.BaseDirectory + "/messages.po",
+                                                                    
this.BaseDirectory,
+                                                                    
monitor.Log,
+                                                                    
monitor.Log,
+                                                                    
null).WaitForExit ();
                        }
+                       monitor.EndTask ();
                }
                public void RemoveEntry (string msgstr)
                {
@@ -302,13 +310,14 @@
                                                Directory.CreateDirectory 
(moDirectory);
                                        string moFileName  = Path.Combine 
(moDirectory, config.PackageName + ".mo");
                                        
-                                       System.Diagnostics.Process process = 
new System.Diagnostics.Process ();
-                                       process.StartInfo.FileName = "msgfmt";
-                                       process.StartInfo.Arguments = 
poFileName + " -o " + moFileName;
-                                       process.StartInfo.UseShellExecute = 
false;
-                                       process.StartInfo.RedirectStandardError 
= true;
-                                       process.Start ();
+                                       ProcessWrapper process = 
Runtime.ProcessService.StartProcess ("msgfmt",
+                                                                    poFileName 
+ " -o " + moFileName,
+                                                                    
this.BaseDirectory,
+                                                                    
monitor.Log,
+                                                                    
monitor.Log,
+                                                                    null);
                                        process.WaitForExit ();
+
                                        if (process.ExitCode == 0) {
                                                monitor.Log.WriteLine 
(GettextCatalog.GetString ("Translation {0}: Compilation succeeded.", 
translation.IsoCode));
                                        } else {
@@ -445,7 +454,7 @@
                        this.name = name;
                }
 
-               public object Clone ()
+               public object Clone ()          
                {
                        IConfiguration conf = (IConfiguration) MemberwiseClone 
();
                        conf.CopyFrom (this);

Modified: 
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationService.cs
===================================================================
--- 
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationService.cs
      2007-11-20 12:30:56 UTC (rev 89970)
+++ 
trunk/monodevelop/Extras/MonoDevelop.Gettext/MonoDevelop.Gettext/TranslationService.cs
      2007-11-20 12:45:11 UTC (rev 89971)
@@ -73,14 +73,14 @@
 //                     return null;
 //             }
                
-               static int GetLineNumber (string text, int index)
-               {
-                       int result = 0;
-                       for (int i = 0; i < index; i++)
-                               if (text[i] == '\n')
-                                       result++;
-                       return result;
-               }
+//             static int GetLineNumber (string text, int index)
+//             {
+//                     int result = 0;
+//                     for (int i = 0; i < index; i++)
+//                             if (text[i] == '\n')
+//                                     result++;
+//                     return result;
+//             }
                
                static void CombineOpened (object sender, CombineEventArgs e)
                {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to