PATCH for gfloppy



I've posted attached patch twice for approval to Jonathan Blandford and I got
no answer for free weeks. It's rather simple so please could someone
competent take a look at this and say "it's ok to commit"? As for now i18n
doesn't work very well in gfloppy.


Zbigniew
diff -ru /home/cyba/gcvs/gfloppy/ChangeLog gfloppy/ChangeLog
--- /home/cyba/gcvs/gfloppy/ChangeLog	Sun Dec  3 16:33:05 2000
+++ gfloppy/ChangeLog	Mon Dec  4 01:44:01 2000
@@ -1,3 +1,14 @@
+2000-12-04  Zbigniew Chyla  <cyba gnome pl>
+
+	* po/POTFILES.in: Added src/badblocks.c.
+
+	* src/badblocks.c, src/gfloppy.c: Included <gnome.h>,
+	marked string for translation.
+
+	* progress.c: Included "config.h".
+
+	* src/gfloppy.glade, src/gfloppy-i18n.h: Recreated with glade.
+
 2000-11-22 John Fleck <jfleck inkstain net>
 
 	* more doc/C/Makefile.am cleanup to silence error
diff -ru /home/cyba/gcvs/gfloppy/po/POTFILES.in gfloppy/po/POTFILES.in
--- /home/cyba/gcvs/gfloppy/po/POTFILES.in	Mon Nov 13 20:17:50 2000
+++ gfloppy/po/POTFILES.in	Mon Dec  4 01:40:00 2000
@@ -1,5 +1,6 @@
 # List of source files containing translatable strings.
 
+src/badblocks.c
 src/fdformat.c
 src/gfloppy.c
 src/main.c
diff -ru /home/cyba/gcvs/gfloppy/src/badblocks.c gfloppy/src/badblocks.c
--- /home/cyba/gcvs/gfloppy/src/badblocks.c	Mon Nov 13 20:17:50 2000
+++ gfloppy/src/badblocks.c	Mon Dec  4 01:40:00 2000
@@ -26,6 +26,8 @@
 
 #include "config.h"
 
+#include <gnome.h>
+
 #include <errno.h>
 #include <fcntl.h>
 
@@ -97,7 +99,7 @@
 	/* Seek to the correct loc. */
 	if (ext2fs_llseek (dev, (ext2_loff_t) current_block * block_size,
 			   SEEK_SET) != (ext2_loff_t) current_block * block_size)
-		fd_print (internal_floppy, "MInternal Error: Unable to seek to the correct location.");
+		fd_print (internal_floppy, _("MInternal Error: Unable to seek to the correct location."));
 
 	/* Try the read */
 	got = read (dev, buffer, try * block_size);
@@ -106,7 +108,7 @@
 		got = 0;	
 	if (got & 511) {
 		gchar *msg;
-		msg = g_strdup_printf ("MInternal Error: Weird value (%ld) in do_test\n", got);
+		msg = g_strdup_printf (_("MInternal Error: Weird value (%ld) in do_test\n"), got);
 		fd_print (internal_floppy, msg);
 		g_free (msg);
 	}
@@ -161,7 +163,7 @@
 
 		if (got == 0) {
 			currently_testing++;
-			msg = g_strdup_printf ("EBad block at block %lu", currently_testing);
+			msg = g_strdup_printf (_("EBad block at block %lu"), currently_testing);
 			fd_print (internal_floppy, msg);
 			g_free (msg);
 			
@@ -255,7 +257,7 @@
 
 /*	while (!i)
 	;*/
-	fd_print (floppy, "MChecking for bad blocks...");
+	fd_print (floppy, _("MChecking for bad blocks..."));
 	internal_floppy = floppy;
 	/* assume read-only test for now */
 	w_flag = 0;
@@ -267,7 +269,7 @@
 
 	dev = open (floppy->device, w_flag ? O_RDWR : O_RDONLY);
 	if (dev < 0) {
-		msg = g_strdup_printf ("MFailed to open device %s for badblock checking\n",
+		msg = g_strdup_printf (_("MFailed to open device %s for badblock checking\n"),
 			floppy->device);
 		fd_print (floppy, msg);
 		g_free (msg);
@@ -286,6 +288,6 @@
 	test_ro (dev, blocks_count, block_size, from_count);
 
 	close (dev);
-	fd_print (floppy, "MChecking for bad blocks... Done");
+	fd_print (floppy, _("MChecking for bad blocks... Done"));
 	return 0;
 }
diff -ru /home/cyba/gcvs/gfloppy/src/gfloppy-i18n.h gfloppy/src/gfloppy-i18n.h
--- /home/cyba/gcvs/gfloppy/src/gfloppy-i18n.h	Mon Nov 13 20:17:50 2000
+++ gfloppy/src/gfloppy-i18n.h	Mon Dec  4 01:40:00 2000
@@ -5,16 +5,14 @@
  */
 
 gchar *s = N_("Format a floppy");
-gchar *s = N_("Linux Native (ext2)\n"
-              "Dos (FAT)\n"
-              "");
+gchar *s = N_("Linux Native (ext2)");
+gchar *s = N_("Dos (FAT)");
 gchar *s = N_("Linux Native (ext2)");
 gchar *s = N_("Formatting /dev/floppy");
 gchar *s = N_("Floppy Density:");
 gchar *s = N_("File system type:");
-gchar *s = N_("High Density 3.5\" (1.44 MB)\n"
-              "High Density 5.25\" (1.2 MB)\n"
-              "Double Density 3.5\" (720 KB)\n"
-              "Double Density 5.25\" (360 KB)\n"
-              "");
+gchar *s = N_("High Density 3.5\" (1.44 MB)");
+gchar *s = N_("High Density 5.25\" (1.2 MB)");
+gchar *s = N_("Double Density 3.5\" (720 KB)");
+gchar *s = N_("Double Density 5.25\" (360 KB)");
 gchar *s = N_("Quick format");
diff -ru /home/cyba/gcvs/gfloppy/src/gfloppy.c gfloppy/src/gfloppy.c
--- /home/cyba/gcvs/gfloppy/src/gfloppy.c	Mon Nov 13 20:17:50 2000
+++ gfloppy/src/gfloppy.c	Mon Dec  4 01:40:00 2000
@@ -17,10 +17,9 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  * USA
  */
-
 #include "config.h"
 
-#include <glib.h>
+#include <gnome.h>
 
 #include <stdio.h>
 #include <fcntl.h>
@@ -164,14 +163,14 @@
 	/* make the filesystem */
 	cmd = make_mke2fs_cmd (floppy);
 
-	fd_print (floppy, "MMaking filesystem on disk...");
+	fd_print (floppy, _("MMaking filesystem on disk..."));
 	rc = system (cmd);
 	if (rc > 3) {
-		fd_print (floppy, "EUnable to create filesystem correctly.");
+		fd_print (floppy, _("EUnable to create filesystem correctly."));
 		return -1;
 	}
 
-	fd_print (floppy, "MMaking filesystem on disk... Done");
+	fd_print (floppy, _("MMaking filesystem on disk... Done"));
 	if (floppy->quick_format)
 		fd_print (floppy, "P100");
 	
@@ -197,25 +196,25 @@
 
 	/* make the filesystem */
 	cmd = make_mformat_cmd (floppy);
-	fd_print (floppy, "MMaking filesystem on disk...");
+	fd_print (floppy, _("MMaking filesystem on disk..."));
 	rc = system (cmd);
 	if (rc != 0) {
-		fd_print (floppy, "EUnable to create filesystem.");
+		fd_print (floppy, _("EUnable to create filesystem."));
 		return -1;
 	}
-	fd_print (floppy, "MMaking filesystem on disk... Done");
+	fd_print (floppy, _("MMaking filesystem on disk... Done"));
 	if (floppy->quick_format)
 		fd_print (floppy, "P100");
 
 	/* check for bad_blocks */
 	if (!floppy->quick_format) {
-		fd_print (floppy, "MChecking for bad blocks... (this might take a while)"); 
+		fd_print (floppy, _("MChecking for bad blocks... (this might take a while)")); 
 		rc = system (g_strconcat (floppy->badblocks_cmd, " ", floppy->mdevice, NULL));
 		if (rc == 0) {
 			fd_print (floppy, "P100");
-			fd_print (floppy, "MChecking for bad blocks... Done");
+			fd_print (floppy, _("MChecking for bad blocks... Done"));
 		} else {
-			fd_print (floppy, "EUnable to create filesystem.");
+			fd_print (floppy, _("EUnable to create filesystem."));
 			return -1;
 		}
 	}
diff -ru /home/cyba/gcvs/gfloppy/src/gfloppy.glade gfloppy/src/gfloppy.glade
--- /home/cyba/gcvs/gfloppy/src/gfloppy.glade	Mon Nov 13 20:17:50 2000
+++ gfloppy/src/gfloppy.glade	Mon Dec  4 01:40:00 2000
@@ -45,6 +45,24 @@
     </child>
 
     <widget>
+      <class>GtkHButtonBox</class>
+      <child_name>GnomeDialog:action_area</child_name>
+      <name>dialog-action_area1</name>
+      <layout_style>GTK_BUTTONBOX_END</layout_style>
+      <spacing>8</spacing>
+      <child_min_width>85</child_min_width>
+      <child_min_height>27</child_min_height>
+      <child_ipad_x>7</child_ipad_x>
+      <child_ipad_y>0</child_ipad_y>
+      <child>
+	<padding>0</padding>
+	<expand>False</expand>
+	<fill>True</fill>
+	<pack>GTK_PACK_END</pack>
+      </child>
+    </widget>
+
+    <widget>
       <class>GtkHBox</class>
       <name>hbox1</name>
       <homogeneous>False</homogeneous>
@@ -280,24 +298,6 @@
 	  </child>
 	</widget>
       </widget>
-    </widget>
-
-    <widget>
-      <class>GtkHButtonBox</class>
-      <child_name>GnomeDialog:action_area</child_name>
-      <name>dialog-action_area1</name>
-      <layout_style>GTK_BUTTONBOX_END</layout_style>
-      <spacing>8</spacing>
-      <child_min_width>85</child_min_width>
-      <child_min_height>27</child_min_height>
-      <child_ipad_x>7</child_ipad_x>
-      <child_ipad_y>0</child_ipad_y>
-      <child>
-	<padding>0</padding>
-	<expand>False</expand>
-	<fill>True</fill>
-	<pack>GTK_PACK_END</pack>
-      </child>
     </widget>
   </widget>
 </widget>
diff -ru /home/cyba/gcvs/gfloppy/src/progress.c gfloppy/src/progress.c
--- /home/cyba/gcvs/gfloppy/src/progress.c	Mon Nov 13 20:17:50 2000
+++ gfloppy/src/progress.c	Mon Dec  4 01:40:00 2000
@@ -17,6 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  * USA
  */
+#include "config.h"
 #include <sys/wait.h>
 #include <signal.h>
 #include <gnome.h>


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