[patches] pluralization, and some trifles along the way

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

 



Hi,

Attached bunch of patches fix most of the issues reported by  Petr Písař
two days ago.  It also fixes some small things I noticed along the way.

The patches are simple.  The eighth and fifteenth patch are slightly special,
as they don't consume all the arguments to fdisk_info() in the singular case;
I haven't checked whether that actually works.

The help text of partx had a blank line after the three command options.
Later the --update option was added, but *after* the blank line.  The twelfth
patch moves it to before the blank line, and even to before the --show option
to harmonize better with the rest of the text.  The patch also corrects the
argument of the --output option, from <type> to <list>.  Oh, and it tries
to describe better what the TYPE column shows -- I'm not entirely sure about
this: I had to read the code to see what it was doing.

The thirteenth patch gettextizes an overlooked message, pluralizes it, and
rewords it to avoid ambiguity (past tense/present tense).

Benno

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/help/overview_quotes.html

From 707ca9f914048cb81ea49ee4c8a1bb19772ed638 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 21:50:05 +0200
Subject: [PATCH 01/15] textual: end both the singular and the plural message with a period

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 libfdisk/src/gpt.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index 9715e38..054a771 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -1530,7 +1530,7 @@ static int gpt_verify_disklabel(struct fdisk_context *cxt)
 		       free_sectors, nsegments, largest_segment);
 	} else
 		fdisk_warnx(cxt,
-			P_("%d error detected.", "%s errors detected", nerror),
+			P_("%d error detected.", "%s errors detected.", nerror),
 			nerror);
 
 	return 0;
-- 
1.7.0.4

From a730358750e0b60c7be3fe003caf2c2bd52df113 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 21:59:02 +0200
Subject: [PATCH 02/15] hexsyntax: in help text, wrap argument of option -e in angular brackets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 text-utils/hexsyntax.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/text-utils/hexsyntax.c b/text-utils/hexsyntax.c
index 2910ca5..1b8040c 100644
--- a/text-utils/hexsyntax.c
+++ b/text-utils/hexsyntax.c
@@ -147,7 +147,7 @@ void __attribute__((__noreturn__)) usage(FILE *out)
 	fputs(_(" -d, --two-bytes-decimal   two-byte decimal display\n"), out);
 	fputs(_(" -o, --two-bytes-octal     two-byte octal display\n"), out);
 	fputs(_(" -x, --two-bytes-hex       two-byte hexadecimal display\n"), out);
-	fputs(_(" -e, --format format       format string to be used for displaying data\n"), out);
+	fputs(_(" -e, --format <format>     format string to be used for displaying data\n"), out);
 	fputs(_(" -f, --format-file <file>  file that contains format strings\n"), out);
 	fputs(_(" -n, --length <length>     interpret only length bytes of input\n"), out);
 	fputs(_(" -s, --skip <offset>       skip offset bytes from the beginning\n"), out);
-- 
1.7.0.4

From d3bbfbbadfd4eb0f2dd0b501902c8e1744b408e8 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 22:03:58 +0200
Subject: [PATCH 03/15] textual: properly use uppercase in certain abbreviations
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 sys-utils/dmesg.c |    2 +-
 sys-utils/lscpu.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index b55ed8e..5039fe7 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -115,7 +115,7 @@ static const struct dmesg_name facility_names[] =
 	[FAC_BASE(LOG_UUCP)]     = { "uucp",     N_("UUCP subsystem") },
 	[FAC_BASE(LOG_CRON)]     = { "cron",     N_("clock daemon") },
 	[FAC_BASE(LOG_AUTHPRIV)] = { "authpriv", N_("security/authorization messages (private)") },
-	[FAC_BASE(LOG_FTP)]      = { "ftp",      N_("ftp daemon") },
+	[FAC_BASE(LOG_FTP)]      = { "ftp",      N_("FTP daemon") },
 };
 
 /* supported methods to read message buffer
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index d4846e7..992726c 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -257,8 +257,8 @@ static struct lscpu_coldesc coldescs[] =
 	[COL_ADDRESS]      = { "ADDRESS", N_("physical address of a CPU") },
 	[COL_CONFIGURED]   = { "CONFIGURED", N_("shows if the hypervisor has allocated the CPU") },
 	[COL_ONLINE]       = { "ONLINE", N_("shows if Linux currently makes use of the CPU") },
-	[COL_MAXMHZ]	   = { "MAXMHZ", N_("shows the maximum mhz of the CPU") },
-	[COL_MINMHZ]	   = { "MINMHZ", N_("shows the minimum mhz of the CPU") }
+	[COL_MAXMHZ]	   = { "MAXMHZ", N_("shows the maximum MHz of the CPU") },
+	[COL_MINMHZ]	   = { "MINMHZ", N_("shows the minimum MHz of the CPU") }
 };
 
 static int
-- 
1.7.0.4

From a09d9ba107f5b3ed820cd7d2f0114cab807a453c Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 22:15:15 +0200
Subject: [PATCH 04/15] mcookie: pluralize two messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 misc-utils/mcookie.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c
index da641a1..3761c4b 100644
--- a/misc-utils/mcookie.c
+++ b/misc-utils/mcookie.c
@@ -147,8 +147,9 @@ int main(int argc, char **argv)
 			count = hash_file(&ctx, fd);
 			if (verbose)
 				fprintf(stderr,
-					_("Got %d bytes from %s\n"), count,
-					file);
+					P_("Got %d byte from %s\n",
+					   "Got %d bytes from %s\n", count),
+					count, file);
 
 			if (fd != STDIN_FILENO)
 				if (close(fd))
@@ -171,8 +172,9 @@ int main(int argc, char **argv)
 			close(fd);
 			if (verbose)
 				fprintf(stderr,
-					_("Got %d bytes from %s\n"), r,
-					rngs[i].path);
+					P_("Got %d byte from %s\n",
+					   "Got %d bytes from %s\n", r),
+					r, rngs[i].path);
 			if (rngs[i].minlength && r >= rngs[i].minlength)
 				break;
 		} else if (verbose)
-- 
1.7.0.4

From cd59d915d5a0377aa1de63f3915083ea5f393e43 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 22:27:51 +0200
Subject: [PATCH 05/15] su-common: pluralize one message
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 login-utils/su-common.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/login-utils/su-common.c b/login-utils/su-common.c
index 7f1b505..7fd2792 100644
--- a/login-utils/su-common.c
+++ b/login-utils/su-common.c
@@ -807,7 +807,9 @@ su_main (int argc, char **argv, int mode)
 	  num_supp_groups++;
 	  if (num_supp_groups >= NGROUPS_MAX)
 	     errx(EXIT_FAILURE,
-		  _("can't specify more than %d supplemental groups"),
+		  P_("specifying more than %d supplemental group is not possible",
+		     "specifying more than %d supplemental groups is not possible",
+		     NGROUPS_MAX - 1),
 		  NGROUPS_MAX - 1);
 	  gr = getgrnam(optarg);
 	  if (!gr)
-- 
1.7.0.4

From b71b9bdadfb9efb7a2b9851aabf46f071c8b8d62 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 22:32:56 +0200
Subject: [PATCH 06/15] wipefs: pluralize one message
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 misc-utils/wipefs.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index ff2f62f..8ac6c33 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -308,8 +308,10 @@ static void do_wipe_real(blkid_probe pr, const char *devname,
 	if (flags & WP_FL_QUIET)
 		return;
 
-	printf(_("%s: %zd bytes were erased at offset 0x%08jx (%s): "),
-		devname, w->len, w->offset, w->type);
+	printf(P_("%s: %zd byte was erased at offset 0x%08jx (%s): ",
+		  "%s: %zd bytes were erased at offset 0x%08jx (%s): ",
+		  w->len),
+	       devname, w->len, w->offset, w->type);
 
 	for (i = 0; i < w->len; i++) {
 		printf("%02x", w->magic[i]);
-- 
1.7.0.4

From 72e2a8084cb30750a3ec81b8e54418697481054b Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Fri, 4 Oct 2013 22:44:28 +0200
Subject: [PATCH 07/15] mkfs.minix: properly pluralize four messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 disk-utils/mkfs.minix.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c
index 639ace7..dd2cf43 100644
--- a/disk-utils/mkfs.minix.c
+++ b/disk-utils/mkfs.minix.c
@@ -541,8 +541,8 @@ static void setup_tables(void) {
 		err(MKFS_EX_ERROR, _("%s: unable to allocate buffer for inodes"),
 				device_name);
 	memset(inode_buffer,0, get_inode_buffer_size());
-	printf(_("%lu inodes\n"), inodes);
-	printf(_("%lu blocks\n"), zones);
+	printf(P_("%lu inode\n", "%lu inodes\n", inodes), inodes);
+	printf(P_("%lu block\n", "%lu blocks\n", zones), zones);
 	printf(_("Firstdatazone=%jd (%jd)\n"), get_first_zone(), first_zone_data());
 	printf(_("Zonesize=%zu\n"), (size_t) MINIX_BLOCK_SIZE << get_zone_size());
 	printf(_("Maxsize=%zu\n\n"),get_max_size());
@@ -614,10 +614,8 @@ static void check_blocks(void) {
 		badblocks++;
 		currently_testing++;
 	}
-	if (badblocks > 1)
-		printf(_("%d bad blocks\n"), badblocks);
-	else if (badblocks == 1)
-		printf(_("one bad block\n"));
+	if (badblocks > 0)
+		printf(P_("%d bad block\n", "%d bad blocks\n", badblocks), badblocks);
 }
 
 static void get_list_blocks(char *filename) {
@@ -640,10 +638,8 @@ static void get_list_blocks(char *filename) {
 	}
 	fclose(listfile);
 
-	if(badblocks > 1)
-		printf(_("%d bad blocks\n"), badblocks);
-	else if (badblocks == 1)
-		printf(_("one bad block\n"));
+	if (badblocks > 0)
+		printf(P_("%d bad block\n", "%d bad blocks\n", badblocks), badblocks);
 }
 
 int main(int argc, char ** argv) {
-- 
1.7.0.4

From 2b19ac57c12fe7bb80fccdb7fceceac445ceef63 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 10:43:40 +0200
Subject: [PATCH 08/15] libfdisk/sgi: properly pluralize three messages
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 libfdisk/src/sgi.c |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
index d2e8778..f37b8ff 100644
--- a/libfdisk/src/sgi.c
+++ b/libfdisk/src/sgi.c
@@ -417,8 +417,10 @@ static int sgi_check_bootfile(struct fdisk_context *cxt, const char *name)
 		return -EINVAL;
 
 	} else if (sz > sizeof(sgilabel->boot_file)) {
-		fdisk_warnx(cxt, _("Name of Bootfile too long: %zu bytes maximum."),
-				sizeof(sgilabel->boot_file));
+		fdisk_warnx(cxt, P_("Name of bootfile is too long: %zu byte maximum.",
+				    "Name of bootfile is too long: %zu bytes maximum.",
+				    sizeof(sgilabel->boot_file)),
+			    sizeof(sgilabel->boot_file));
 		return -EINVAL;
 
 	} else if (*name != '/') {
@@ -656,19 +658,23 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 			continue;
 		if (start > sgi_get_start_sector(cxt, Index[i])) {
 			if (verbose)
-				fdisk_info(cxt, _("The Partition %d and %d overlap "
-					  "by %d sectors."),
-				       Index[i-1]+1, Index[i]+1,
-				       start - sgi_get_start_sector(cxt, Index[i]));
+				fdisk_info(cxt,
+					   P_("Partitions %d and %d overlap by %d sector.",
+					      "Partitions %d and %d overlap by %d sectors.",
+					      start - sgi_get_start_sector(cxt, Index[i])),
+					   Index[i-1]+1, Index[i]+1,
+					   start - sgi_get_start_sector(cxt, Index[i]));
 			if (gap >  0) gap = -gap;
 			if (gap == 0) gap = -1;
 		}
 		if (start < sgi_get_start_sector(cxt, Index[i])) {
 			if (verbose)
-				fdisk_info(cxt, _("Unused gap of %8u sectors "
-					    "- sectors %8u-%u"),
-				       sgi_get_start_sector(cxt, Index[i]) - start,
-				       start, sgi_get_start_sector(cxt, Index[i])-1);
+				fdisk_info(cxt,
+					   P_("Unused gap of %8u sector: sector %8u",
+					      "Unused gap of %8u sectors: sectors %8u-%u",
+					      sgi_get_start_sector(cxt, Index[i]) - start),
+					   sgi_get_start_sector(cxt, Index[i]) - start,
+					   start, sgi_get_start_sector(cxt, Index[i])-1);
 			gap += sgi_get_start_sector(cxt, Index[i]) - start;
 			add_to_freelist(cxt, start,
 					sgi_get_start_sector(cxt, Index[i]));
@@ -686,8 +692,10 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 	}
 	if (start < lastblock) {
 		if (verbose)
-			fdisk_info(cxt, _("Unused gap of %8u sectors - sectors %8u-%u"),
-				lastblock - start, start, lastblock-1);
+			fdisk_info(cxt, P_("Unused gap of %8u sector: sector %8u",
+					   "Unused gap of %8u sectors: sectors %8u-%u",
+					   lastblock - start),
+				   lastblock - start, start, lastblock-1);
 		gap += lastblock - start;
 		add_to_freelist(cxt, start, lastblock);
 	}
-- 
1.7.0.4

From df27843a2efb5a53664896778d40778c2f9d3376 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 11:01:28 +0200
Subject: [PATCH 09/15] libfdisk/sgi: tweak and harmonize some comments

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 libfdisk/src/sgi.c |   40 +++++++++++++++++-----------------------
 1 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
index f37b8ff..50b95cd 100644
--- a/libfdisk/src/sgi.c
+++ b/libfdisk/src/sgi.c
@@ -3,12 +3,12 @@
  * Copyright (C) 2012 Davidlohr Bueso <dave@xxxxxxx>
  *               2013 Karel Zak <kzak@xxxxxxxxxx>
  *
- * This is re-written version for libfdisk, the original was fdisksgilabel.c
+ * This is a re-written version for libfdisk, the original was fdisksgilabel.c
  * from util-linux fdisk, by:
  *
- *               Andreas Neuper, Sep 1998.
- *               Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>, Mar 1999
- *               Phillip Kesling <pkesling@xxxxxxx>, Mar 2003
+ *               Andreas Neuper, Sep 1998,
+ *               Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>, Mar 1999,
+ *               Phillip Kesling <pkesling@xxxxxxx>, Mar 2003.
  */
 #include "c.h"
 #include "nls.h"
@@ -62,7 +62,7 @@ static unsigned int sgi_get_num_sectors(struct fdisk_context *cxt, int i );
 static int sgi_get_bootpartition(struct fdisk_context *cxt);
 static int sgi_get_swappartition(struct fdisk_context *cxt);
 
-/* return poiter buffer with on-disk data */
+/* Returns a pointer buffer with on-disk data. */
 static inline struct sgi_disklabel *self_disklabel(struct fdisk_context *cxt)
 {
 	assert(cxt);
@@ -72,7 +72,7 @@ static inline struct sgi_disklabel *self_disklabel(struct fdisk_context *cxt)
 	return ((struct fdisk_sgi_label *) cxt->label)->header;
 }
 
-/* return in-memory fdisk data */
+/* Returns in-memory fdisk data. */
 static inline struct fdisk_sgi_label *self_label(struct fdisk_context *cxt)
 {
 	assert(cxt);
@@ -433,8 +433,7 @@ static int sgi_check_bootfile(struct fdisk_context *cxt, const char *name)
 		fdisk_warnx(cxt, _("Be aware, that the bootfile is not checked "
 			"for existence. SGI's default is \"/unix\" and for "
 			"backup \"/unix.save\"."));
-		/* filename is correct and did change */
-		return 0;
+		return 0;	/* filename is correct and did change */
 	}
 
 	return 1;	/* filename did not change */
@@ -493,8 +492,8 @@ static int sgi_write_disklabel(struct fdisk_context *cxt)
 		goto err;
 	if (!strncmp((char *) sgilabel->volume[0].name, "sgilabel", 8)) {
 		/*
-		 * keep this habit of first writing the "sgilabel".
-		 * I never tested whether it works without (AN 981002).
+		 * Keep this habit of first writing the "sgilabel".
+		 * I never tested whether it works without. (AN 1998-10-02)
 		 */
 		int infostartblock
 			= be32_to_cpu(sgilabel->volume[0].block_num);
@@ -520,8 +519,8 @@ static int compare_start(struct fdisk_context *cxt,
 			 const void *x, const void *y)
 {
 	/*
-	 * sort according to start sectors and prefers largest partition: entry
-	 * zero is entire disk entry
+	 * Sort according to start sectors and prefer the largest partition:
+	 * entry zero is the entire-disk entry.
 	 */
 	unsigned int i = *(int *) x;
 	unsigned int j = *(int *) y;
@@ -656,6 +655,7 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 		/* We cannot handle several "entire disk" entries. */
 		if (sgi_get_sysid(cxt, Index[i]) == SGI_TYPE_ENTIRE_DISK)
 			continue;
+
 		if (start > sgi_get_start_sector(cxt, Index[i])) {
 			if (verbose)
 				fdisk_info(cxt,
@@ -681,7 +681,7 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 		}
 		start = sgi_get_start_sector(cxt, Index[i])
 			+ sgi_get_num_sectors(cxt, Index[i]);
-		/* Align free space on cylinder boundary */
+		/* Align free space on cylinder boundary. */
 		if (cylsize && start % cylsize)
 			start += cylsize - (start % cylsize);
 
@@ -700,7 +700,7 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 		add_to_freelist(cxt, start, lastblock);
 	}
 	/*
-	 * Done with arithmetics. Go for details now
+	 * Done with arithmetics. Go for details now.
 	 */
 	if (verbose) {
 		if (sgi_get_bootpartition(cxt) < 0
@@ -739,7 +739,7 @@ static int sgi_gaps(struct fdisk_context *cxt)
 	return verify_disklabel(cxt, 0);
 }
 
-/* returns partition index of first entry marked as entire disk */
+/* Returns partition index of first entry marked as entire disk. */
 static int sgi_entire(struct fdisk_context *cxt)
 {
 	size_t i;
@@ -794,10 +794,7 @@ static void sgi_set_volhdr(struct fdisk_context *cxt)
 
 	for (n = 8; n < cxt->label->nparts_max; n++) {
 		if (!sgi_get_num_sectors(cxt, n)) {
-			/*
-			 * Choose same default volume header size
-			 * as IRIX fx uses.
-			 */
+			/* Choose same default volume header size as IRIX fx uses. */
 			if (4096 < sgi_get_lastblock(cxt))
 				sgi_set_partition(cxt, n, 0, 4096, SGI_TYPE_VOLHDR);
 			break;
@@ -1103,7 +1100,6 @@ static int sgi_get_partition_status(
 		size_t i,
 		int *status)
 {
-
 	assert(cxt);
 	assert(fdisk_is_disklabel(cxt, SGI));
 
@@ -1166,9 +1162,7 @@ static const struct fdisk_label_operations sgi_operations =
 	.part_toggle_flag = sgi_toggle_partition_flag
 };
 
-/*
- * allocates SGI label driver
- */
+/* Allocates an SGI label driver. */
 struct fdisk_label *fdisk_new_sgi_label(struct fdisk_context *cxt)
 {
 	struct fdisk_label *lb;
-- 
1.7.0.4

From 3fda7d86d4e4c2689da14ed64528cd8a1ac177d3 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 11:22:53 +0200
Subject: [PATCH 10/15] libfdisk/sgi: tweak and harmonize some message strings

Using consistent capitals and lowercase, adding missing periods and
a missing space, repositioning commas for clarity, improving grammar,
and aligning substrings for esthetics.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 libfdisk/src/sgi.c |   51 +++++++++++++++++++++++++--------------------------
 1 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
index 50b95cd..8cff394 100644
--- a/libfdisk/src/sgi.c
+++ b/libfdisk/src/sgi.c
@@ -238,7 +238,7 @@ static int sgi_probe_label(struct fdisk_context *cxt)
 	 * test for correct checksum
 	 */
 	if (sgi_pt_checksum(sgilabel) != 0)
-		fdisk_warnx(cxt, _("Detected sgi disklabel with wrong checksum."));
+		fdisk_warnx(cxt, _("Detected an SGI disklabel with wrong checksum."));
 
 	clear_freelist(cxt);
 	cxt->label->nparts_max = SGI_MAXPARTITIONS;
@@ -411,9 +411,9 @@ static int sgi_check_bootfile(struct fdisk_context *cxt, const char *name)
 
 	if (sz < 3) {
 		/* "/a\n" is minimum */
-		fdisk_warnx(cxt, _("Invalid Bootfile! "
-			 "The bootfile must be an absolute non-zero pathname,"
-			 "e.g. \"/unix\" or \"/unix.save\"."));
+		fdisk_warnx(cxt, _("Invalid bootfile!  The bootfile must "
+				   "be an absolute non-zero pathname, "
+				   "e.g. \"/unix\" or \"/unix.save\"."));
 		return -EINVAL;
 
 	} else if (sz > sizeof(sgilabel->boot_file)) {
@@ -430,9 +430,9 @@ static int sgi_check_bootfile(struct fdisk_context *cxt, const char *name)
 
 	if (strncmp(name, (char *) sgilabel->boot_file,
 				sizeof(sgilabel->boot_file))) {
-		fdisk_warnx(cxt, _("Be aware, that the bootfile is not checked "
-			"for existence. SGI's default is \"/unix\" and for "
-			"backup \"/unix.save\"."));
+		fdisk_warnx(cxt, _("Be aware that the bootfile is not checked "
+				   "for existence.  SGI's default is \"/unix\", "
+				   "and for backup \"/unix.save\"."));
 		return 0;	/* filename is correct and did change */
 	}
 
@@ -453,7 +453,7 @@ int fdisk_sgi_set_bootfile(struct fdisk_context *cxt)
 		rc = sgi_check_bootfile(cxt, name);
 	if (rc) {
 		if (rc == 1)
-			fdisk_info(cxt, _("Boot file unchanged"));
+			fdisk_info(cxt, _("Boot file is unchanged."));
 		goto done;
 	}
 
@@ -465,7 +465,7 @@ int fdisk_sgi_set_bootfile(struct fdisk_context *cxt)
 	memcpy(sgilabel->boot_file, name, sz);
 
 	fdisk_sinfo(cxt, FDISK_INFO_SUCCESS,
-			_("Bootfile is changed to \"%s\"."), name);
+			_("Bootfile has been changed to \"%s\"."), name);
 done:
 	free(name);
 	return rc;
@@ -612,7 +612,7 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 	}
 	if (sortcount == 0) {
 		if (verbose)
-			fdisk_info(cxt, _("No partitions defined"));
+			fdisk_info(cxt, _("No partitions defined."));
 		return (lastblock > 0) ? 1 : (lastblock == 0) ? 0 : -1;
 	}
 
@@ -620,13 +620,13 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 
 	if (sgi_get_sysid(cxt, Index[0]) == SGI_TYPE_ENTIRE_DISK) {
 		if (verbose && Index[0] != 10)
-			fdisk_info(cxt, _("IRIX likes when Partition 11 "
+			fdisk_info(cxt, _("IRIX likes it when partition 11 "
 					  "covers the entire disk."));
 
 		if (verbose && sgi_get_start_sector(cxt, Index[0]) != 0)
 			fdisk_info(cxt, _("The entire disk partition should "
-				"start at block 0, not at diskblock %d."),
-			       sgi_get_start_sector(cxt, Index[0]));
+					  "start at block 0, not at block %d."),
+				   sgi_get_start_sector(cxt, Index[0]));
 
 		if (verbose && sgi_get_num_sectors(cxt, Index[0]) != lastblock)
 			DBG(LABEL, dbgprint(
@@ -716,8 +716,7 @@ static int verify_disklabel(struct fdisk_context *cxt, int verbose)
 			fdisk_info(cxt, _("The swap partition has no swap type."));
 
 		if (sgi_check_bootfile(cxt, "/unix"))
-			fdisk_info(cxt, _("You have chosen an unusual boot "
-					  "file name."));
+			fdisk_info(cxt, _("You have chosen an unusual bootfile name."));
 	}
 
 	return (gap > 0) ? 1 : (gap == 0) ? 0 : -1;
@@ -842,8 +841,8 @@ static int sgi_add_partition(struct fdisk_context *cxt,
 	sgi = self_label(cxt);
 
 	if (sgi_get_num_sectors(cxt, n)) {
-		fdisk_warnx(cxt, _("Partition %zd is already defined.  Delete "
-			 "it before re-adding it."), n + 1);
+		fdisk_warnx(cxt, _("Partition %zd is already defined.  "
+				   "Delete it before re-adding it."), n + 1);
 		return -EINVAL;
 	}
 	if (sgi_entire(cxt) == -1 &&  sys != SGI_TYPE_ENTIRE_DISK) {
@@ -890,9 +889,9 @@ static int sgi_add_partition(struct fdisk_context *cxt,
 			return rc;
 
 		if (first && sys == SGI_TYPE_ENTIRE_DISK)
-			fdisk_info(cxt, _("It is highly recommended that "
-					"eleventh partition covers the entire "
-					"disk and is of type `SGI volume'"));
+			fdisk_info(cxt, _("It is highly recommended that the "
+					  "eleventh partition covers the entire "
+					  "disk and is of type 'SGI volume'."));
 
 		if (fdisk_context_use_cylinders(cxt))
 			first *= fdisk_context_get_units_per_sector(cxt);
@@ -902,7 +901,7 @@ static int sgi_add_partition(struct fdisk_context *cxt,
 			last = is_in_freelist(cxt, first);
 		if (last == 0)
 			fdisk_warnx(cxt, _("You will get a partition overlap "
-				"on the disk. Fix it first!"));
+					   "on the disk. Fix it first!"));
 		else
 			break;
 	}
@@ -943,9 +942,9 @@ static int sgi_add_partition(struct fdisk_context *cxt,
 
 	if (sys == SGI_TYPE_ENTIRE_DISK
 	    && (first != 0 || last != sgi_get_lastblock(cxt)))
-		fdisk_info(cxt, _("It is highly recommended that eleventh "
-			"partition covers the entire disk and is of type "
-			"`SGI volume'"));
+		fdisk_info(cxt, _("It is highly recommended that the "
+				  "eleventh partition covers the entire "
+				  "disk and is of type 'SGI volume'."));
 
 	sgi_set_partition(cxt, n, first, last - first, sys);
 	cxt->label->nparts_cur = count_used_partitions(cxt);
@@ -1073,8 +1072,8 @@ static int sgi_set_parttype(struct fdisk_context *cxt,
 	if ((i == 10 && t->type != SGI_TYPE_ENTIRE_DISK)
 	    || (i == 8 && t->type != 0))
 		fdisk_info(cxt, _("Consider leaving partition 9 as volume header (0), "
-			 "and partition 11 as entire volume (6), as IRIX "
-			 "expects it."));
+				  "and partition 11 as entire volume (6), "
+				  "as IRIX expects it."));
 
 	if (((t->type != SGI_TYPE_ENTIRE_DISK) && (t->type != SGI_TYPE_VOLHDR))
 	    && (sgi_get_start_sector(cxt, i) < 1)) {
-- 
1.7.0.4

From d9a4c2348ab9efbb513cf6e6771e414061bedd41 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 11:37:48 +0200
Subject: [PATCH 11/15] partx: pluralize one message
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reported-by: Petr PísaÅ? <petr.pisar@xxxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 disk-utils/partx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index c4b1d73..b69a329 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -523,7 +523,9 @@ static int list_parts(blkid_partlist ls, int lower, int upper)
 		start = blkid_partition_get_start(par);
 		size =  blkid_partition_get_size(par);
 
-		printf(_("#%2d: %9ju-%9ju (%9ju sectors, %6ju MB)\n"),
+		printf(P_("#%2d: %9ju-%9ju (%9ju sector, %6ju MB)\n",
+			  "#%2d: %9ju-%9ju (%9ju sectors, %6ju MB)\n",
+			  size),
 		       n, start, start + size -1,
 		       size, (size << 9) / 1000000);
 	}
-- 
1.7.0.4

From 3c698d18239088b0fc565f433094ad293fd82e98 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 12:01:32 +0200
Subject: [PATCH 12/15] partx: correct three messages

Properly describing the partition type, using a verb instead of a noun,
putting the blank line after the command options, and using the correct
argument for --output.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 disk-utils/partx.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/disk-utils/partx.c b/disk-utils/partx.c
index b69a329..880d779 100644
--- a/disk-utils/partx.c
+++ b/disk-utils/partx.c
@@ -86,7 +86,7 @@ struct colinfo infos[] = {
 	[COL_UUID]     = { "UUID",    36, 0, N_("partition UUID")},
 	[COL_SCHEME]   = { "SCHEME",  0.1, TT_FL_TRUNC, N_("partition table type (dos, gpt, ...)")},
 	[COL_FLAGS]    = { "FLAGS",   0.1, TT_FL_TRUNC, N_("partition flags")},
-	[COL_TYPE]     = { "TYPE",    1, TT_FL_RIGHT, N_("partition type hex or uuid")},
+	[COL_TYPE]     = { "TYPE",    1, TT_FL_RIGHT, N_("partition type (a string, a UUID, or hex)")},
 };
 
 #define NCOLS ARRAY_SIZE(infos)
@@ -121,7 +121,7 @@ static void assoc_loopdev(const char *fname)
 	rc = loopcxt_setup_device(&lc);
 
 	if (rc == -EBUSY)
-		err(EXIT_FAILURE, _("%s: failed to setup loop device"), fname);
+		err(EXIT_FAILURE, _("%s: failed to set up loop device"), fname);
 
 	loopdev = 1;
 }
@@ -700,12 +700,12 @@ static void __attribute__((__noreturn__)) usage(FILE *out)
 	fputs(USAGE_OPTIONS, out);
 	fputs(_(" -a, --add            add specified partitions or all of them\n"), out);
 	fputs(_(" -d, --delete         delete specified partitions or all of them\n"), out);
-	fputs(_(" -s, --show           list partitions\n\n"), out);
 	fputs(_(" -u, --update         update specified partitions or all of them\n"), out);
+	fputs(_(" -s, --show           list partitions\n\n"), out);
 	fputs(_(" -b, --bytes          print SIZE in bytes rather than in human readable format\n"), out);
 	fputs(_(" -g, --noheadings     don't print headings for --show\n"), out);
 	fputs(_(" -n, --nr <n:m>       specify the range of partitions (e.g. --nr 2:4)\n"), out);
-	fputs(_(" -o, --output <type>  define which output columns to use\n"), out);
+	fputs(_(" -o, --output <list>  define which output columns to use\n"), out);
 	fputs(_(" -P, --pairs          use key=\"value\" output format\n"), out);
 	fputs(_(" -r, --raw            use raw output format\n"), out);
 	fputs(_(" -t, --type <type>    specify the partition type (dos, bsd, solaris, etc.)\n"), out);
-- 
1.7.0.4

From 87ff1ca482602f8d4a6dc837f6527d53ed6989e2 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 23:12:23 +0200
Subject: [PATCH 13/15] wdctl: gettextize and pluralize one forgotten message

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 sys-utils/wdctl.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
index 2698853..7130918 100644
--- a/sys-utils/wdctl.c
+++ b/sys-utils/wdctl.c
@@ -334,7 +334,8 @@ static int set_watchdog(struct wdinfo *wd, int timeout)
 	if (close_fd(fd))
 		warn(_("write failed"));
 	sigprocmask(SIG_SETMASK, &oldsigs, NULL);
-	printf("Set timeout to %d seconds\n", timeout);
+	printf(P_("Timeout has been set to %d second.\n",
+		  "Timeout has been set to %d seconds.\n", timeout), timeout);
 
 	return rc;
 }
-- 
1.7.0.4

From 376ca54fa3e658d24b945687edad08a00fecf79d Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 5 Oct 2013 23:19:55 +0200
Subject: [PATCH 14/15] wdctl: pluralize one thrice-repeated message

Also put in one hard space, to keep text and number separated when
the translated string should be too long.

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

diff --git a/sys-utils/wdctl.c b/sys-utils/wdctl.c
index 7130918..c0953c9 100644
--- a/sys-utils/wdctl.c
+++ b/sys-utils/wdctl.c
@@ -450,11 +450,14 @@ static void print_oneline(struct wdinfo *wd, uint32_t wanted,
 static void show_timeouts(struct wdinfo *wd)
 {
 	if (wd->has_timeout)
-		printf(_("%-15s%2i seconds\n"), _("Timeout:"), wd->timeout);
+		printf(P_("%-14s %2i second\n", "%-14s %2i seconds\n", wd->timeout),
+			  _("Timeout:"), wd->timeout);
 	if (wd->has_pretimeout)
-		printf(_("%-15s%2i seconds\n"), _("Pre-timeout:"), wd->pretimeout);
+		printf(P_("%-14s %2i second\n", "%-14s %2i seconds\n", wd->pretimeout),
+			  _("Pre-timeout:"), wd->pretimeout);
 	if (wd->has_timeleft)
-		printf(_("%-15s%2i seconds\n"), _("Timeleft:"), wd->timeleft);
+		printf(P_("%-14s %2i second\n", "%-14s %2i seconds\n", wd->timeleft),
+			  _("Timeleft:"), wd->timeleft);
 }
 
 int main(int argc, char *argv[])
-- 
1.7.0.4

From 65697521041228328260dafea8e0037c17c45485 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sun, 6 Oct 2013 11:49:54 +0200
Subject: [PATCH 15/15] libfdisk/gpt: partly pluralize one message

And don't mention the largest when there is only one segment.

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 libfdisk/src/gpt.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index 054a771..6bd2fb7 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -1525,9 +1525,11 @@ static int gpt_verify_disklabel(struct fdisk_context *cxt)
 
 		free_sectors = get_free_sectors(cxt, gpt->pheader, gpt->ents,
 						&nsegments, &largest_segment);
-		fdisk_info(cxt, _("A total of %ld free sectors available in %d segment(s) "
-			 "(largest %ld)."),
-		       free_sectors, nsegments, largest_segment);
+		fdisk_info(cxt,
+			   P_("A total of %ld free sectors is available in %d segment.",
+			      "A total of %ld free sectors is available in %d segments "
+			      "(the largest is %ld).", nsegments),
+			   free_sectors, nsegments, largest_segment);
 	} else
 		fdisk_warnx(cxt,
 			P_("%d error detected.", "%s errors detected.", nerror),
-- 
1.7.0.4


[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