[Monodevelop-patches-list] r1358 - in trunk/MonoDevelop: po src/Libraries/MonoDevelop.Core src/Libraries/MonoDevelop.Core/Services src/Libraries/MonoDevelop.Gui.Widgets src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog src/Libraries/MonoDevelop.Gui.Widgets/Tree src/Main/Base src/Main/Base/Services

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Fri Apr 2 23:31:21 EST 2004


Author: tberman
Date: 2004-04-02 23:31:21 -0500 (Fri, 02 Apr 2004)
New Revision: 1358

Added:
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/ChangeLog
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/Services/GettextCatalog.cs
Removed:
   trunk/MonoDevelop/src/Main/Base/Services/GettextCatalog.cs
Modified:
   trunk/MonoDevelop/po/POTFILES.in
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/Makefile.am
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/BaseFileEntry.cs
   trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNodeCollection.cs
   trunk/MonoDevelop/src/Main/Base/ChangeLog
   trunk/MonoDevelop/src/Main/Base/Makefile.am
Log:
moving gettext stuff to .Core, gettextifyin .widgets


Modified: trunk/MonoDevelop/po/POTFILES.in
===================================================================
--- trunk/MonoDevelop/po/POTFILES.in	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/po/POTFILES.in	2004-04-03 04:31:21 UTC (rev 1358)
@@ -81,3 +81,6 @@
 src/Main/Base/Services/Project/DefaultProjectService.cs
 src/Main/Base/Services/StatusBar/DefaultStatusBarService.cs
 src/Main/Base/Services/ResourceNotFoundException.cs
+src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs
+src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/BaseFileEntry.cs
+src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNodeCollection.cs

Added: trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/ChangeLog	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/ChangeLog	2004-04-03 04:31:21 UTC (rev 1358)
@@ -0,0 +1,4 @@
+2004-04-02  Todd Berman  <tberman at sevenl.net>
+
+	* Makefile.am: add GettextCatalog.cs.
+	* Services/GettextCatalog.cs: move here so other libs can use easier.

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/Makefile.am	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/Makefile.am	2004-04-03 04:31:21 UTC (rev 1358)
@@ -56,7 +56,8 @@
 ./AddIns/TypeNotFoundException.cs \
 ./AddIns/AddInInitializeException.cs \
 ./AddIns/AddInCollection.cs \
-./AddIns/AddInSignatureException.cs
+./AddIns/AddInSignatureException.cs \
+./Services/GettextCatalog.cs
 
 build_sources = $(addprefix $(srcdir)/, $(FILES))
 

Copied: trunk/MonoDevelop/src/Libraries/MonoDevelop.Core/Services/GettextCatalog.cs (from rev 1355, trunk/MonoDevelop/src/Main/Base/Services/GettextCatalog.cs)

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/ChangeLog	2004-04-03 04:31:21 UTC (rev 1358)
@@ -1,8 +1,15 @@
+2004-04-03  Todd Berman  <tberman at sevenl.net>
+
+	* Tree/TreeNodeCollection.cs:
+	* FileBrowser/FileBrowser.cs:
+	* FolderDialog/BaseFileEntry.cs:
+	gettextify
+
 2004-03-31  Todd Berman  <tberman at sevenl.net>
 
 	* Tree/TreeNode.cs:
-	* Tree/TreeView.cs: Fixing gtk+ 2.4 regression with the change from enum to
-	integer. Using RenderIcon to workaround.
+	* Tree/TreeView.cs: Fixing gtk+ 2.4 regression with the change from
+	enum to integer. Using RenderIcon to workaround.
 
 2004-03-27  Todd Berman  <tberman at sevenl.net>
 

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs	2004-04-03 04:31:21 UTC (rev 1358)
@@ -15,6 +15,7 @@
 using MonoDevelop.Core.Properties;
 using MonoDevelop.Core.Services;
 using MonoDevelop.Gui.Utils;
+using MonoDevelop.Services;
 
 namespace MonoDevelop.Gui.Widgets
 {
@@ -249,19 +250,19 @@
 		private void ShowPopup ()
 		{
 			Menu menu = new Menu ();
-			MenuItem openfilebrowser = new MenuItem ("Open with file browser");
+			MenuItem openfilebrowser = new MenuItem (GettextCatalog.GetString ("Open with file browser"));
 			openfilebrowser.Activated += new EventHandler (OpenFileBrowser);
 
-			MenuItem openterminal = new MenuItem ("Open with terminal");
+			MenuItem openterminal = new MenuItem (GettextCatalog.GetString ("Open with terminal"));
 			openterminal.Activated += new EventHandler (OpenTerminal);
 
-			MenuItem rename = new MenuItem ("Rename");
+			MenuItem rename = new MenuItem (GettextCatalog.GetString ("Rename"));
 			rename.Activated += new EventHandler (OnDirRename);
 
-			MenuItem delete = new MenuItem ("Delete");
+			MenuItem delete = new MenuItem (GettextCatalog.GetString ("Delete"));
 			delete.Activated += new EventHandler (OnDirDelete);
 
-			MenuItem newfolder = new MenuItem ("Create new folder");
+			MenuItem newfolder = new MenuItem (GettextCatalog.GetString ("Create new folder"));
 			newfolder.Activated += new EventHandler (OnNewDir);
 
 			menu.Append (newfolder);
@@ -324,7 +325,7 @@
 				CurrentDir = entry.Text;
 			else
 			{
-    			messageService.ShowError (null, "Cannot enter '" + entry.Text + "' folder");
+    			messageService.ShowError (null, String.Format (GettextCatalog.GetString ("Cannot enter '{0}' folder"), entry.Text));
 			}
 		}
 
@@ -360,7 +361,7 @@
     					}
     					catch (Exception ex)
     					{
-    						messageService.ShowError (ex, "Could not rename folder '" + oldpath + "' to '" + args.NewText + "'");
+    						messageService.ShowError (ex, String.Format (GettextCatalog.GetString ("Could not rename folder '{0}' to '{1}'"), oldpath, args.NewText));
     					}
     					finally
     					{
@@ -378,7 +379,7 @@
 					}
 					catch (Exception ex)
 					{
-    					messageService.ShowError (ex, "Could not create new folder '" + args.NewText + "'");
+    					messageService.ShowError (ex, String.Format (GettextCatalog.GetString ("Could not create new folder '{0}'"), args.NewText));
 					}
 					finally
 					{
@@ -400,7 +401,7 @@
 			TreeIter iter;
 			TreeModel model;
 
-			if (messageService.AskQuestion ("Are you sure you want to delete this folder?", "Delete folder"))
+			if (messageService.AskQuestion (GettextCatalog.GetString ("Are you sure you want to delete this folder?"), GettextCatalog.GetString ("Delete folder")))
 			{
 				if (tv.Selection.GetSelected (out model, out iter))
 				{
@@ -410,7 +411,7 @@
 					}
 					catch (Exception ex)
 					{
-						messageService.ShowError (ex, "Could not delete folder '" + System.IO.Path.Combine (CurrentDir, (string) store.GetValue (iter, 1)) + "'");
+						messageService.ShowError (ex, String.Format (GettextCatalog.GetString ("Could not delete folder '{0}'"), System.IO.Path.Combine (CurrentDir, (string) store.GetValue (iter, 1))));
 					}
 					finally
 					{

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/BaseFileEntry.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/BaseFileEntry.cs	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/BaseFileEntry.cs	2004-04-03 04:31:21 UTC (rev 1358)
@@ -5,6 +5,8 @@
 using GtkSharp;
 using GdkSharp;
 
+using MonoDevelop.Services;
+
 namespace MonoDevelop.Gui.Widgets {
 	public abstract class BaseFileEntry : Gtk.HBox {
 		
@@ -19,7 +21,7 @@
 		{
 			this.name = name;
 			text = new Entry ();
-			browse = Button.NewWithMnemonic ("_Browse...");
+			browse = Button.NewWithMnemonic (GettextCatalog.GetString ("_Browse..."));
 			
 			text.Changed += new EventHandler (OnTextChanged);
 			browse.Clicked += new EventHandler (OnButtonClicked);

Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNodeCollection.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNodeCollection.cs	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/Tree/TreeNodeCollection.cs	2004-04-03 04:31:21 UTC (rev 1358)
@@ -1,6 +1,8 @@
 using System;
 using System.Collections;
 
+using MonoDevelop.Services;
+
 namespace MonoDevelop.Gui.Widgets {
     public class TreeNodeCollection: IList {
 		private ArrayList list;
@@ -166,7 +168,7 @@
 
 		void IList.Remove(object value){
 			if (value is TreeNode == false) {
-				throw new Exception ("Attempt to remove a non node from the tree");
+				throw new Exception (GettextCatalog.GetString ("Attempt to remove a non node from the tree"));
 			}
 			Remove((TreeNode)value);
 		}

Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog	2004-04-03 04:31:21 UTC (rev 1358)
@@ -1,3 +1,8 @@
+2004-04-03  Todd Berman  <tberman at sevenl.net>
+
+	* Services/GettextCatalog.cs: moved to .Core.
+	* Makefile.am: reflect above change.
+
 2004-04-02  Todd Berman  <tberman at sevenl.net>
 
 	* Services/File/DefaultFileService.cs:

Modified: trunk/MonoDevelop/src/Main/Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Makefile.am	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Main/Base/Makefile.am	2004-04-03 04:31:21 UTC (rev 1358)
@@ -215,7 +215,6 @@
 ./Services/Toolbar/ToolbarService.cs \
 ./Services/MonodocService.cs \
 ./Services/IDebuggerService.cs \
-./Services/GettextCatalog.cs \
 ./Internal/Undo/IUndoableOperation.cs \
 ./Internal/Undo/UndoStack.cs \
 ./Internal/Undo/UndoQueue.cs \

Deleted: trunk/MonoDevelop/src/Main/Base/Services/GettextCatalog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/GettextCatalog.cs	2004-04-03 04:02:59 UTC (rev 1357)
+++ trunk/MonoDevelop/src/Main/Base/Services/GettextCatalog.cs	2004-04-03 04:31:21 UTC (rev 1358)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2004 Jorn Baayen <jorn at nl.linux.org>
- * 
- * Modified by Todd Berman <tberman at sevenl.net> to fit with MonoDevelop.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * !!! Note that this class has to have the same API as the one
- *     from GNU.Gettext.dll, because otherwise the strings won't
- *     be picked up by update-po.
- */
-
-using System.Runtime.InteropServices;
-
-using MonoDevelop.Core.Services;
-using MonoDevelop.Core.AddIns;
-
-namespace MonoDevelop.Services
-{
-
-	public class GettextCatalog
-	{
-
-		[DllImport ("libmonodevelop")]
-		private static extern void intl_init (string package);
-	
-		static GettextCatalog ()
-		{
-			intl_init ("monodevelop");
-		}
-	
-		[DllImport ("libmonodevelop")]
-		private static extern string intl_get_string (string str);
-	
-		public static string GetString (string str)
-		{
-			return intl_get_string (str);
-		}
-	
-		[DllImport ("libmonodevelop")]
-		private static extern string intl_get_plural_string (string singular,
-								     string plural,
-								     int n);
-	
-		public static string GetPluralString (string singular,
-			    	 	              string plural,
-					              int n)
-		{
-			return intl_get_plural_string (singular, plural, n);
-		}
-	}
-}




More information about the Monodevelop-patches-list mailing list