[patches] pluralization and tiny adjustments of some messages

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

 



Hi,

Attached bunch of nine patches correct some mistaken words in
some of the messages, and adds pluralization to three messages
of the uuidd deamon.  Most of these things were first noticed by
the Czech translator Petr Pisar.

Regards,

Benno



-- 
http://www.fastmail.fm - A fast, anti-spam email service.

From 275ffed75f7c2e2e2907d53b7b4e47760adb0a7a Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 15:35:16 +0200
Subject: [PATCH 1/9] partx.c: switch on localization (noted by Petr Pisar)

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

diff --git a/partx/partx.c b/partx/partx.c
index a42c189..b2a72ed 100644
--- a/partx/partx.c
+++ b/partx/partx.c
@@ -640,6 +640,10 @@ int main(int argc, char **argv)
 		{ NULL, 0, NULL, 0 }
 	};
 
+	setlocale(LC_ALL, "");
+	bindtextdomain(PACKAGE, LOCALEDIR);
+	textdomain(PACKAGE);
+
 	while ((c = getopt_long(argc, argv,
 				"abdglrsvn:t:o:Ph", long_opts, NULL)) != -1) {
 
-- 
1.7.0.4

From 57f33663ad2b97a216f62273cf34744a1d2071fe Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 17:13:27 +0200
Subject: [PATCH 2/9] lsblk.c: correct mistaken word (noted by Petr Pisar)

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

diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index 50b3bcc..92d4a00 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -789,7 +789,7 @@ static int process_one_device(char *devname)
 		return EXIT_FAILURE;
 	}
 	if (blkid_devno_to_wholedisk(st.st_rdev, buf, sizeof(buf), &disk)) {
-		warn(_("%s: failed to get whole-list devno"), devname);
+		warn(_("%s: failed to get whole-disk device number"), devname);
 		return EXIT_FAILURE;
 	}
 	if (st.st_rdev == disk) {
-- 
1.7.0.4

From 01af34d1fd02ae3ff0ab12a3fd921bc29ed56355 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 17:16:09 +0200
Subject: [PATCH 3/9] fstrim.c: correct mistaken grammar in one message

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

diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
index 533a274..597f781 100644
--- a/sys-utils/fstrim.c
+++ b/sys-utils/fstrim.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
 		err(EXIT_FAILURE, _("%s: FITRIM ioctl failed"), path);
 
 	if (verbose)
-		printf(_("%s: %" PRIu64 " bytes was trimmed\n"),
+		printf(_("%s: %" PRIu64 " bytes were trimmed\n"),
 						path, (uint64_t) range.len);
 	close(fd);
 	return EXIT_SUCCESS;
-- 
1.7.0.4

From 9363e5374057e59832ef9835f7faed91283b0304 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 17:17:26 +0200
Subject: [PATCH 4/9] wipefs.c: gettextize one sentence as a whole

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

diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c
index 51b6fad..09c6070 100644
--- a/misc-utils/wipefs.c
+++ b/misc-utils/wipefs.c
@@ -237,7 +237,8 @@ do_wipe_offset(int fd, struct wipe_desc *wp, const char *fname, int noact)
 	if (noact == 0 && write_all(fd, buf, len))
 		err(EXIT_FAILURE, _("%s: write failed"), fname);
 
-	printf(_("%zd bytes ["), wp->len);
+	printf(_("%zd bytes were erased at offset 0x%jx (%s)\nthey were: "),
+	       wp->len, wp->offset, wp->type);
 
 	for (i = 0; i < len; i++) {
 		printf("%02x", wp->magic[i]);
@@ -245,7 +246,7 @@ do_wipe_offset(int fd, struct wipe_desc *wp, const char *fname, int noact)
 			fputc(' ', stdout);
 	}
 
-	printf(_("] erased at offset 0x%jx (%s)\n"), wp->offset, wp->type);
+	printf("\n");
 	return 0;
 }
 
-- 
1.7.0.4

From bc8b7db0e535717c72bdc4629c0769002f7369ef Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 19:20:58 +0200
Subject: [PATCH 5/9] nls.h: define a macro for handling plurals with ngettext()

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 include/nls.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/nls.h b/include/nls.h
index 00f2e37..9a9311b 100644
--- a/include/nls.h
+++ b/include/nls.h
@@ -22,6 +22,7 @@ int main(int argc, char *argv[]);
 # else
 #  define N_(String) (String)
 # endif
+# define P_(Singular, Plural, n) ngettext (Singular, Plural, n)
 #else
 # undef bindtextdomain
 # define bindtextdomain(Domain, Directory) /* empty */
@@ -29,6 +30,7 @@ int main(int argc, char *argv[]);
 # define textdomain(Domain) /* empty */
 # define _(Text) (Text)
 # define N_(Text) (Text)
+# define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural))
 #endif
 
 #ifdef HAVE_LANGINFO_H
-- 
1.7.0.4

From 4a38316f2100ebfc7f9423d339082e5a9399abbd Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 19:21:52 +0200
Subject: [PATCH 6/9] uuidd.c: distinguish between singular and plural in three messages

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 misc-utils/uuidd.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c
index 3d130af..6aaf17f 100644
--- a/misc-utils/uuidd.c
+++ b/misc-utils/uuidd.c
@@ -376,8 +376,11 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
 			__uuid_generate_time(uu, &num);
 			if (debug) {
 				uuid_unparse(uu, str);
-				printf(_("Generated time UUID %s and %d "
-					 "following\n"), str, num - 1);
+				printf(P_("Generated time UUID %s "
+					  "and %d following\n",
+					  "Generated time UUID %s "
+					  "and %d following\n", num - 1),
+				       str, num - 1);
 			}
 			memcpy(reply_buf, uu, sizeof(uu));
 			reply_len = sizeof(uu);
@@ -394,7 +397,8 @@ static void server_loop(const char *socket_path, const char *pidfile_path,
 			__uuid_generate_random((unsigned char *) reply_buf +
 					      sizeof(num), &num);
 			if (debug) {
-				printf(_("Generated %d UUIDs:\n"), num);
+				printf(P_("Generated %d UUID:\n",
+					  "Generated %d UUIDs:\n", num), num);
 				for (i = 0, cp = reply_buf + sizeof(num);
 				     i < num;
 				     i++, cp += UUID_LEN) {
@@ -543,7 +547,9 @@ int main(int argc, char **argv)
 
 			uuid_unparse((unsigned char *) buf, str);
 
-			printf(_("%s and subsequent %d UUIDs\n"), str, num - 1);
+			printf(P_("%s and %d subsequent UUID\n",
+				  "%s and %d subsequent UUIDs\n", num - 1),
+			       str, num - 1);
 		} else {
 			printf(_("List of UUIDs:\n"));
 			cp = buf + 4;
-- 
1.7.0.4

From d1055bbcf5aa4601f55d55da0ec88672034fad05 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 21:27:16 +0200
Subject: [PATCH 7/9] po: also extract plural messages from the C files

Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
---
 po/Makevars |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/po/Makevars b/po/Makevars
index f6e320c..04f1b21 100644
--- a/po/Makevars
+++ b/po/Makevars
@@ -8,7 +8,7 @@ subdir = po
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=P_:1,2
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
-- 
1.7.0.4

From a524cae461131c03a109662cf8f6e9229ef28f6b Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sat, 30 Jul 2011 21:28:07 +0200
Subject: [PATCH 8/9] textual: add some guiding comments for translators

These are picked up by xgettext and put in the POT file.

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

diff --git a/login-utils/login.c b/login-utils/login.c
index 74e0cdd..555a567 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -1356,6 +1356,7 @@ static void
 timedout(int sig) {
 	signal(SIGALRM, timedout2);
 	alarm(10);
+	/* TRANSLATORS: The standard value for %d is 60. */
 	warnx(_("timed out after %d seconds"), timeout);
 	signal(SIGALRM, SIG_IGN);
 	alarm(0);
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c
index 92d4a00..67989e1 100644
--- a/misc-utils/lsblk.c
+++ b/misc-utils/lsblk.c
@@ -856,6 +856,7 @@ static void parse_excludes(const char *str)
 		excludes[nexcludes++] = n;
 
 		if (nexcludes == ARRAY_SIZE(excludes))
+			/* TRANSLATORS: The standard value for %d is 256. */
 			errx(EXIT_FAILURE, _("the list of excluded devices is "
 					"too large (limit is %d devices)"),
 					(int)ARRAY_SIZE(excludes));
diff --git a/sys-utils/fstrim.c b/sys-utils/fstrim.c
index 597f781..0006091 100644
--- a/sys-utils/fstrim.c
+++ b/sys-utils/fstrim.c
@@ -143,6 +143,7 @@ int main(int argc, char **argv)
 		err(EXIT_FAILURE, _("%s: FITRIM ioctl failed"), path);
 
 	if (verbose)
+		/* TRANSLATORS: The standard value here is a very large number. */
 		printf(_("%s: %" PRIu64 " bytes were trimmed\n"),
 						path, (uint64_t) range.len);
 	close(fd);
-- 
1.7.0.4

From ddb1cef9ccf713bedf19e3c1df51a027cb85722a Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@xxxxxxxxxxxxx>
Date: Sun, 31 Jul 2011 21:27:58 +0200
Subject: [PATCH 9/9] fsck.c: use same word category in message, and add translators comment

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

diff --git a/fsck/fsck.c b/fsck/fsck.c
index 52b9d9d..88a67c8 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -291,7 +291,8 @@ static void lock_disk(struct fsck_instance *inst)
 	}
 
 	if (verbose)
-		printf("%s.\n", inst->lock >= 0 ? _("success") : _("failed"));
+		/* TRANSLATORS: These are followups to "Locking disk...". */
+		printf("%s.\n", inst->lock >= 0 ? _("succeeded") : _("failed"));
 
 	free(diskname);
 	return;
-- 
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