I18N Patch



Larry,

Here you have a patch to allow to localise some strings that are
currently hardcoded in F-Spot. Specially interesting the default tag
names, that are widely use.

Best Regards,
-- 
Jordi Mas i Hernàndez - Mono development team - http://www.mono-project.com
Homepage and LiveJournal at http://www.softcatala.org/~jmas

Index: po/POTFILES.in
===================================================================
RCS file: /cvs/gnome/f-spot/po/POTFILES.in,v
retrieving revision 1.14
diff -u -r1.14 POTFILES.in
--- po/POTFILES.in	18 Apr 2005 17:19:15 -0000	1.14
+++ po/POTFILES.in	21 May 2005 17:31:14 -0000
@@ -21,13 +21,16 @@
 src/InfoDisplay.cs
 src/MainWindow.cs
 src/PhotoPopup.cs
+src/PhotoStore.cs
 src/PhotoTagMenu.cs
 src/PhotoVersionCommands.cs
+src/PhotoVersionMenu.cs
 src/PhotoView.cs
 src/ProgressDialog.cs
 src/RotateCommand.cs
 src/StockIcons.cs
 src/TagCommands.cs
 src/TagPopup.cs
+src/TagStore.cs
 src/Util.cs
 src/VfsExport.cs
Index: src/MainWindow.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/MainWindow.cs,v
retrieving revision 1.185
diff -u -r1.185 MainWindow.cs
--- src/MainWindow.cs	20 May 2005 02:31:45 -0000	1.185
+++ src/MainWindow.cs	21 May 2005 17:31:43 -0000
@@ -125,7 +125,6 @@
 	{
 		this.db = db;
 
-		Mono.Posix.Catalog.Init ("f-spot", FSpot.Defines.LOCALE_DIR);
 		Glade.XML gui = Glade.XML.FromAssembly ("f-spot.glade", "main_window", "f-spot");
 		gui.Autoconnect (this);
 
Index: src/PhotoStore.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/PhotoStore.cs,v
retrieving revision 1.61
diff -u -r1.61 PhotoStore.cs
--- src/PhotoStore.cs	9 May 2005 05:52:29 -0000	1.61
+++ src/PhotoStore.cs	21 May 2005 17:32:02 -0000
@@ -275,11 +275,10 @@
 		int num = 1;
 
 		while (true) {
-			string name;
-			if (num == 1)
-				name = "Modified";
-			else
-				name = String.Format ("Modified ({0})", num);
+			string name = Mono.Posix.Catalog.GetPluralString ("Modified", 
+								 "Modified ({0})", 
+								 num);
+			name = String.Format (name, num);
 
 			if (! VersionNameExists (name))
 				return CreateVersion (name, base_version_id, create_file);
@@ -373,7 +372,7 @@
 
 		// Note that the original version is never stored in the photo_versions table in the
 		// database.
-		AddVersionUnsafely (OriginalVersionId, "Original");
+		AddVersionUnsafely (OriginalVersionId, Mono.Posix.Catalog.GetString ("Original"));
 	}
 
 	public Photo (uint id, uint unix_time, string path)
Index: src/PhotoVersionMenu.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/PhotoVersionMenu.cs,v
retrieving revision 1.1
diff -u -r1.1 PhotoVersionMenu.cs
--- src/PhotoVersionMenu.cs	9 Nov 2003 10:10:51 -0000	1.1
+++ src/PhotoVersionMenu.cs	21 May 2005 17:32:03 -0000
@@ -81,7 +81,7 @@
 		}
 
 		if (version_ids.Length == 1) {
-			MenuItem no_edits_menu_item = new MenuItem ("(No Edits)");
+			MenuItem no_edits_menu_item = new MenuItem (Mono.Posix.Catalog.GetString ("(No Edits)"));
 			no_edits_menu_item.Show ();
 			no_edits_menu_item.Sensitive = false;
 			Append (no_edits_menu_item);
Index: src/TagStore.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/TagStore.cs,v
retrieving revision 1.17
diff -u -r1.17 TagStore.cs
--- src/TagStore.cs	10 Mar 2005 02:48:53 -0000	1.17
+++ src/TagStore.cs	21 May 2005 17:32:09 -0000
@@ -240,7 +240,7 @@
 			tag.SortPriority = Convert.ToInt32 (reader[3]);
 			AddToCache (tag);
 			
-			if (tag.Name == "Hidden")
+			if (tag.Name == Mono.Posix.Catalog.GetString ("Hidden"))
 				hidden = tag;
 		}
 
@@ -295,33 +295,33 @@
 
 	private void CreateDefaultTags ()
 	{
-		Tag favorites_tag = CreateTag (RootCategory, "Favorites");
+		Tag favorites_tag = CreateTag (RootCategory, Mono.Posix.Catalog.GetString ("Favorites"));
 		favorites_tag.StockIconName = "f-spot-favorite.png";
 		favorites_tag.SortPriority = -10;
 		Commit (favorites_tag);
 
-		Tag hidden_tag = CreateTag (RootCategory, "Hidden");
+		Tag hidden_tag = CreateTag (RootCategory, Mono.Posix.Catalog.GetString ("Hidden"));
 		hidden_tag.StockIconName = "f-spot-hidden.png";
 		hidden_tag.SortPriority = -9;
 		this.hidden = hidden_tag;
 		Commit (hidden_tag);
 
-		Tag people_category = CreateCategory (RootCategory, "People");
+		Tag people_category = CreateCategory (RootCategory, Mono.Posix.Catalog.GetString ("People"));
 		people_category.StockIconName = "f-spot-people.png";
 		people_category.SortPriority = -8;
 		Commit (people_category);
 
-		Tag places_category = CreateCategory (RootCategory, "Places");
+		Tag places_category = CreateCategory (RootCategory, Mono.Posix.Catalog.GetString ("Places"));
 		places_category.StockIconName = "f-spot-places.png";
 		places_category.SortPriority = -8;
 		Commit (places_category);
 
-		Tag events_category = CreateCategory (RootCategory, "Events");
+		Tag events_category = CreateCategory (RootCategory, Mono.Posix.Catalog.GetString ("Events"));
 		events_category.StockIconName = "f-spot-events.png";
 		events_category.SortPriority = -7;
 		Commit (events_category);
 
-		Tag other_category = CreateCategory (RootCategory, "Other");
+		Tag other_category = CreateCategory (RootCategory, Mono.Posix.Catalog.GetString ("Other"));
 		other_category.StockIconName = "f-spot-other.png";
 		other_category.SortPriority = -6;
 		Commit (other_category);
Index: src/main.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/main.cs,v
retrieving revision 1.11
diff -u -r1.11 main.cs
--- src/main.cs	27 Feb 2005 14:43:45 -0000	1.11
+++ src/main.cs	21 May 2005 17:32:10 -0000
@@ -13,6 +13,8 @@
 		Gnome.Vfs.Vfs.Initialize ();
 		StockIcons.Initialize ();
 
+		Mono.Posix.Catalog.Init ("f-spot", FSpot.Defines.LOCALE_DIR);
+
 		// FIXME: Error checking is non-existant here...
 
 		string base_directory = FSpot.Global.BaseDirectory;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]