[patch] gettextize, ungettextize, and tweak some messages

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

 



Hi,

The first patch adds three calls to gettext, so that in 'cfdisk' the 
names of partition types are now actually translated in the normal 
overview, in the table printout, and in the long list of system 
types.

English is quite a concise language, but several others are not; 
therefore the second patch increases the size of the menu buttons 
of 'cfdisk', so that in Dutch instead of printing this menu line:

[opstartBaar[verwijDeren[  Hulp  ]  [Maximeren] [P:tonen ]

it prints a slightly more readable one:

[opstartBaar] [verwijDeren] [   Hulp   ]  [Maximeren ]  [ P:tonen  ]

As shown the size of 10 still allows five buttons to fit on an 
80-columns screen.  With a size of 11 only four would fit, changing 
the normal menu to three lines instead of two (on an 80-columns 
screen).

The third patch tweaks a few messages for clarity: adding a period, 
a space, a comma, or a word.  It also adds a missing call to 
gettext, and while at it undoes an unneeded linewrap.

The fourth patch ungettextizes a series of debugging messages.  The 
normal user will never see these, so translating them is a waste of 
time.

Benno
>From 5dc3bdb9ff8145cb71d1e46017e8f2e5e86c7ad8 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 29 Sep 2007 15:02:28 +0200
Subject: [PATCH] Translate partition-type names when they are printed.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 fdisk/cfdisk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index e3941d8..538e4d7 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -391,7 +391,7 @@ partition_type_text(int i) {
 	 else
 	      return _("NTFS");
     } else
-	 return partition_type_name(p_info[i].id);
+	 return _(partition_type_name(p_info[i].id));
 }
 
 static void
@@ -2067,7 +2067,7 @@ print_p_info_entry(FILE *fp, partition_info *p) {
     else if (p->id == FREE_SPACE)
 	sprintf(part_str, "%.15s", _("Free Space"));
     else if (partition_type_name(p->id))
-	sprintf(part_str, "%.15s (%02X)", partition_type_name(p->id), p->id);
+	sprintf(part_str, "%.15s (%02X)", _(partition_type_name(p->id)), p->id);
     else
 	sprintf(part_str, "%.15s (%02X)", _("Unknown"), p->id);
     fp_printf(fp, "%-20.20s", part_str);
@@ -2483,7 +2483,7 @@ change_id(int i) {
 		move(row, ((j-1)/num_down)*COL_ID_WIDTH + 1);
 		printw("%02X %-20.20s",
 		       i386_sys_types[j].type,
-		       i386_sys_types[j].name);
+		       _(i386_sys_types[j].name));
 	    }
 	    if (row > row_max)
 		needmore = 1;
-- 
1.5.2.5

>From b4ed02ca7ae719f058242b33dc64aed40736369b Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 29 Sep 2007 15:04:50 +0200
Subject: [PATCH] Slightly increase the size of menu buttons.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 fdisk/cfdisk.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 538e4d7..a965752 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -2766,15 +2766,15 @@ do_curses_fdisk(void) {
 
 	if (p_info[cur_part].id == FREE_SPACE) {
 	    s = ((opentype == O_RDWR) ? "hnpquW" : "hnpqu");
-	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 8,
+	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
 	        s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0);
 	} else if (p_info[cur_part].id > 0) {
 	    s = ((opentype == O_RDWR) ? "bdhmpqtuW" : "bdhmpqtu");
-	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 8,
+	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
 	        s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0);
 	} else {
 	    s = ((opentype == O_RDWR) ? "hpquW" : "hpqu");
-	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 8,
+	    command = menuSelect(COMMAND_LINE_Y, COMMAND_LINE_X, menuMain, 10,
 	        s, MENU_HORIZ | MENU_BUTTON | MENU_ACCEPT_OTHERS, 0);
 	}
 	switch ( command ) {
-- 
1.5.2.5

>From a2bc9b992b889bf6fd7876c528fbbbeb0e4d00be Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 29 Sep 2007 15:14:42 +0200
Subject: [PATCH] Tweak a few messages for clarity.

Add a missing period, a missing space, a comma and a word for clarity,
plus a period and an uppercase letter to match surrounding messages.
Further add a missing call to gettext, and undo an unneeded linewrap.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 disk-utils/mkswap.c |    6 +++---
 fdisk/cfdisk.c      |    2 +-
 fdisk/fdisk.c       |    2 +-
 login-utils/chsh.c  |    4 ++--
 sys-utils/ipcs.c    |    5 ++---
 5 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index 6af1ff7..e98d3f1 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -686,9 +686,9 @@ main(int argc, char ** argv) {
 			if (!sum) {
 				fprintf(stderr, _("\
 %s: Device '%s' contains a valid Sun disklabel.\n\
-This probably means creating v0 swap would destroy your partition table\n\
-No swap created. If you really want to create swap v0 on that device, use\n\
-the -f option to force it.\n"),
+This probably means creating v0 swap would destroy your partition table.\n\
+No swap was created. If you really want to create v0 swap on that device,\n\
+use the -f option to force it.\n"),
 					program_name, device_name);
 				exit(1);
 			}
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index a965752..03d520e 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -1209,7 +1209,7 @@ menuSelect( int y, int x, struct MenuItem *menuItems, int itemLength,
     int i, ylast = y, key = 0, current = menuDefault;
 
     if( !( menuType & ( MENU_HORIZ | MENU_VERT ) ) ) {
-        print_warning(_("Menu without direction. Defaulting horizontal."));
+        print_warning(_("Menu without direction. Defaulting to horizontal."));
         menuType |= MENU_HORIZ;
     }
 
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 89a4925..aa6004e 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -1494,7 +1494,7 @@ change_sysid(void) {
 					  || (i == 8 && sys != 0)))
 				printf(_("Consider leaving partition 9 "
 				       "as volume header (0),\nand "
-				       "partition 11 as entire volume (6)"
+				       "partition 11 as entire volume (6), "
 				       "as IRIX expects it.\n\n"));
                         if (sys == origsys)
 				break;
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index 15733a2..bf027cb 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -363,11 +363,11 @@ check_shell (char *shell) {
 #ifdef ONLY_LISTED_SHELLS
     if (! get_shell_list (shell)) {
        if (!getuid())
-	  printf (_("Warning: \"%s\" is not listed in /etc/shells\n"), shell);
+	  printf (_("Warning: \"%s\" is not listed in /etc/shells.\n"), shell);
        else {
 	  printf (_("%s: \"%s\" is not listed in /etc/shells.\n"),
 		  whoami, shell);
-	  printf( _("%s: use -l option to see list\n"), whoami );
+	  printf( _("%s: Use -l option to see list.\n"), whoami );
 	  exit(1);
        }
     }
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 0c2316b..1b3400c 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -419,7 +419,7 @@ void do_sem (char format)
 	case CREATOR:
 		printf (_("------ Semaphore Arrays Creators/Owners --------\n"));
 		printf (_("%-10s %-10s %-10s %-10s %-10s %-10s\n"),
-		 _("semid"),_("perms"),_("cuid"),_("cgid"),_("uid"),("gid"));
+		 _("semid"),_("perms"),_("cuid"),_("cgid"),_("uid"),_("gid"));
 		break;
 
 	case TIME:
@@ -434,8 +434,7 @@ void do_sem (char format)
 	default:
 		printf (_("------ Semaphore Arrays --------\n"));
 		printf (_("%-10s %-10s %-10s %-10s %-10s\n"), 
-			_("key"),_("semid"),_("owner"),_("perms"),
-			_("nsems"));
+			_("key"),_("semid"),_("owner"),_("perms"),_("nsems"));
 		break;
 	}
 
-- 
1.5.2.5

>From f99ed98726f57fc6a7ad86a0a2692eec4d356571 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 29 Sep 2007 15:18:28 +0200
Subject: [PATCH] Ungettextize several debugging messages.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 login-utils/agetty.c   |   28 ++++++++++++++--------------
 login-utils/shutdown.c |    2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/login-utils/agetty.c b/login-utils/agetty.c
index ff27b70..739bbe8 100644
--- a/login-utils/agetty.c
+++ b/login-utils/agetty.c
@@ -322,7 +322,7 @@ main(argc, argv)
     update_utmp(options.tty);
 #endif
 
-    debug(_("calling open_tty\n"));
+    debug("calling open_tty\n");
     /* Open the tty as standard { input, output, error }. */
     open_tty(options.tty, &termio, options.flags & F_LOCAL);
 
@@ -335,12 +335,12 @@ main(argc, argv)
 	}
 #endif
     /* Initialize the termio settings (raw mode, eight-bit, blocking i/o). */
-    debug(_("calling termio_init\n"));
+    debug("calling termio_init\n");
     termio_init(&termio, options.speeds[FIRST_SPEED], &options);
 
     /* write the modem init string and DON'T flush the buffers */
     if (options.flags & F_INITSTRING) {
-	debug(_("writing init string\n"));
+	debug("writing init string\n");
 	write(1, options.initstring, strlen(options.initstring));
     }
 
@@ -350,7 +350,7 @@ main(argc, argv)
     }
 
     /* Optionally detect the baud rate from the modem status message. */
-    debug(_("before autobaud\n"));
+    debug("before autobaud\n");
     if (options.flags & F_PARSE)
 	auto_baud(&termio);
 
@@ -362,11 +362,11 @@ main(argc, argv)
     if (options.flags & F_WAITCRLF) {
 	char ch;
 
-	debug(_("waiting for cr-lf\n"));
+	debug("waiting for cr-lf\n");
 	while(read(0, &ch, 1) == 1) {
 	    ch &= 0x7f;   /* strip "parity bit" */
 #ifdef DEBUGGING
-	    fprintf(dbf, _("read %c\n"), ch);
+	    fprintf(dbf, "read %c\n", ch);
 #endif
 	    if (ch == '\n' || ch == '\r') break;
 	}
@@ -375,7 +375,7 @@ main(argc, argv)
     chardata = init_chardata;
     if (!(options.flags & F_NOPROMPT)) {
 	/* Read the login name. */
-	debug(_("reading login name\n"));
+	debug("reading login name\n");
 	while ((logname = get_logname(&options, &chardata, &termio)) == 0)
 	  next_speed(&termio, &options);
     }
@@ -493,7 +493,7 @@ parse_args(argc, argv, op)
 	    usage();
 	}
     }
- 	debug(_("after getopt loop\n"));
+ 	debug("after getopt loop\n");
     if (argc < optind + 2)			/* check parameter count */
 	usage();
 
@@ -543,7 +543,7 @@ parse_args(argc, argv, op)
     }
 #endif
 
-    debug(_("exiting parseargs\n"));
+    debug("exiting parseargs\n");
 }
 
 /* parse_speeds - parse alternate baud rates */
@@ -555,14 +555,14 @@ parse_speeds(op, arg)
 {
     char   *cp;
 
-	debug(_("entered parse_speeds\n"));
+	debug("entered parse_speeds\n");
     for (cp = strtok(arg, ","); cp != 0; cp = strtok((char *) 0, ",")) {
 	if ((op->speeds[op->numspeed++] = bcode(cp)) <= 0)
 	    error(_("bad speed: %s"), cp);
 	if (op->numspeed >= MAX_SPEED)
 	    error(_("too many alternate speeds"));
     }
-    debug(_("exiting parsespeeds\n"));
+    debug("exiting parsespeeds\n");
 }
 
 #ifdef	SYSV_STYLE
@@ -673,7 +673,7 @@ open_tty(tty, tp, local)
 	(void) close(0);
 	errno = 0;				/* ignore close(2) errors */
 
-	debug(_("open(2)\n"));
+	debug("open(2)\n");
 	if (open(tty, O_RDWR|O_NONBLOCK, 0) != 0)
 	    error(_("/dev/%s: cannot open as standard input: %m"), tty);
 
@@ -689,7 +689,7 @@ open_tty(tty, tp, local)
     }
 
     /* Set up standard output and standard error file descriptors. */
-    debug(_("duping\n"));
+    debug("duping\n");
     if (dup(0) != 1 || dup(0) != 2)		/* set up stdout and stderr */
 	error(_("%s: dup problem: %m"), tty);	/* we have a problem */
 
@@ -765,7 +765,7 @@ termio_init(tp, speed, op)
     /* go to blocking input even in local mode */
     fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) & ~O_NONBLOCK);
 
-    debug(_("term_io 2\n"));
+    debug("term_io 2\n");
 }
 
 /* auto_baud - extract baud rate from modem status message */
diff --git a/login-utils/shutdown.c b/login-utils/shutdown.c
index d89f374..189c36a 100644
--- a/login-utils/shutdown.c
+++ b/login-utils/shutdown.c
@@ -308,7 +308,7 @@ main(int argc, char *argv[])
 	}
 
 #ifdef DEBUGGING
-	printf(_("timeout = %d, quiet = %d, reboot = %d\n"),
+	printf("timeout = %d, quiet = %d, reboot = %d\n",
 		timeout, opt_quiet, opt_reboot);
 #endif
 	
-- 
1.5.2.5


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux