gfs2-utils: master - mkfs.gfs2: Add translator doc comments

Andrew Price andyp at fedoraproject.org
Thu Jan 10 09:44:23 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=1ac13ea39ae0ac09f8ea062a889a852a115681a5
Commit:        1ac13ea39ae0ac09f8ea062a889a852a115681a5
Parent:        dc8cfec21502d89e2c1283d1bb72c4d14f58f6c9
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Mon Jan 7 09:56:21 2013 +0000
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Mon Jan 7 09:56:21 2013 +0000

mkfs.gfs2: Add translator doc comments

Adds documentation comments (beginning with 'Translators:') to
translateable strings in mkfs. Also updates some strings to ease
translation.

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 gfs2/mkfs/main_grow.c |   10 ++++----
 gfs2/mkfs/main_jadd.c |    3 ++
 gfs2/mkfs/main_mkfs.c |   50 +++++++++++++++++++++++++++++++++++-------------
 po/Makevars           |    2 +-
 4 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 8c8f23b..d1e1d02 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -66,7 +66,7 @@ static void usage(void)
 	const char *options[] = {
 		"-h", NULL, _("Display this usage information"),
 		"-q", NULL, _("Quiet, reduce verbosity"),
-		"-T", NULL, _("Do everything except update FS"),
+		"-T", NULL, _("Do everything except update file system"),
 		"-V", NULL, _("Display version information"),
 		"-v", NULL, _("Increase verbosity"),
 		NULL, NULL, NULL /* Must be kept at the end */
@@ -235,7 +235,7 @@ static void fix_rindex(struct gfs2_sbd *sdp, int rindex_fd, int old_rg_count)
 		}
 		if (statbuf.st_size !=
 		    old_rg_count * sizeof(struct gfs2_rindex)) {
-			log_crit(_("Incorrect rindex size. want %ld(%d RGs), "
+			log_crit(_("Incorrect rindex size. want %ld(%d resource groups), "
 				 "have %ld\n"),
 				 old_rg_count * sizeof(struct gfs2_rindex),
 				 old_rg_count, statbuf.st_size);
@@ -374,7 +374,7 @@ main_grow(int argc, char *argv[])
 		}
 		fix_device_geometry(sdp);
 		if (mount_gfs2_meta(sdp)) {
-			perror(_("GFS2 metafs mount failed"));
+			perror(_("Failed to mount GFS2 meta file system"));
 			exit(EXIT_FAILURE);
 		}
 
@@ -408,10 +408,10 @@ main_grow(int argc, char *argv[])
 		fsgrowth = ((sdp->device.length - fssize) * sdp->bsize);
 		if (fsgrowth < rgsize * sdp->bsize) {
 			log_err( _("Error: The device has grown by less than "
-				"one Resource Group (RG).\n"));
+				"one resource group.\n"));
 			log_err( _("The device grew by %lluMB. "),
 				(unsigned long long)fsgrowth / MB);
-			log_err( _("One RG is %uMB for this file system.\n"),
+			log_err( _("One resource group is %uMB for this file system.\n"),
 				(rgsize * sdp->bsize) / MB);
 		}
 		else {
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index da4a401..dfe5f5b 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -79,6 +79,9 @@ static void print_usage(const char *prog_name)
 	int i;
 	const char *option, *param, *desc;
 	const char *options[] = {
+		/* Translators: This is a usage string printed with --help.
+		   <size> and <number> here are  to commandline parameters,
+		   e.g. gfs2_jadd -j <number> /dev/sda */
 		"-c", "<size>",   _("Size of quota change file, in megabytes"),
 		"-D", NULL,       _("Enable debugging code"),
 		"-h", NULL,       _("Display this help, then exit"),
diff --git a/gfs2/mkfs/main_mkfs.c b/gfs2/mkfs/main_mkfs.c
index b83ffec..181f743 100644
--- a/gfs2/mkfs/main_mkfs.c
+++ b/gfs2/mkfs/main_mkfs.c
@@ -52,6 +52,9 @@ print_usage(const char *prog_name)
 	int i;
 	const char *option, *param, *desc;
 	const char *options[] = {
+	    /* Translators: This is a usage string printed with --help.
+	       <size> and <number> here are  to commandline parameters,
+	       e.g. mkfs.gfs2 -b <size> -j <number> /dev/sda */
 	    "-b", _("<size>"),   _("File system block size, in bytes"),
 	    "-c", _("<size>"),   _("Size of quota change file, in megabytes"),
 	    "-D", NULL,          _("Enable debugging code"),
@@ -93,7 +96,9 @@ static int discard_blocks(struct gfs2_sbd *sdp)
 	range[0] = 0;
 	range[1] = sdp->device.length * sdp->bsize;
 	if (sdp->debug)
-		printf(_("Issuing discard ioctl: range: %llu - %llu..."),
+		/* Translators: "discard" is a request sent to a storage device to
+		 * discard a range of blocks. */
+		printf(_("Issuing discard request: range: %llu - %llu..."),
 		       (unsigned long long)range[0],
 		       (unsigned long long)range[1]);
 	if (ioctl(sdp->device_fd, BLKDISCARD, &range) < 0) {
@@ -162,7 +167,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
 
 		case 'p':
 			if (strlen(optarg) >= GFS2_LOCKNAME_LEN)
-				die( _("lock protocol name %s is too long\n"),
+				die( _("lock protocol name '%s' is too long\n"),
 				    optarg);
 			strcpy(sdp->lockproto, optarg);
 			break;
@@ -177,7 +182,7 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
 
 		case 't':
 			if (strlen(optarg) >= GFS2_LOCKNAME_LEN)
-				die( _("lock table name %s is too long\n"), optarg);
+				die( _("lock table name '%s' is too long\n"), optarg);
 			strcpy(sdp->locktable, optarg);
 			break;
 
@@ -264,6 +269,8 @@ static void decode_arguments(int argc, char *argv[], struct gfs2_sbd *sdp)
 static void test_locking(char *lockproto, char *locktable)
 {
 	char *c;
+	/* Translators: A lock table is a string identifying a gfs2 file system
+	 * in a cluster, e.g. cluster_name:fs_name */
 	const char *errprefix = _("Invalid lock table:");
 
 	if (strcmp(lockproto, "lock_nolock") == 0) {
@@ -314,6 +321,11 @@ static void are_you_sure(void)
 	int res = 0;
 
 	do{
+		/* Translators: We use rpmatch(3) to match the answers to y/n
+		   questions in the user's own language, so the [y/n] here must also be
+		   translated to match one of the letters in the pattern printed by
+		   `locale -k yesexpr` and one of the letters in the pattern printed by
+		   `locale -k noexpr` */
 		printf( _("Are you sure you want to proceed? [y/n]"));
 		ret = getline(&line, &len, stdin);
 		res = rpmatch(line);
@@ -324,7 +336,7 @@ static void are_you_sure(void)
 		}
 		if (!res){
 			printf("\n");
-			die( _("aborted\n"));
+			die( _("Aborted.\n"));
 		}
 		
 	}while(ret >= 0);
@@ -344,8 +356,8 @@ static void verify_bsize(struct gfs2_sbd *sdp)
 			break;
 
 	if (!x || sdp->bsize > getpagesize())
-		die( _("block size must be a power of two between 512 and "
-		       "%d\n"), getpagesize());
+		die( _("Block size must be a power of two between 512 and %d\n"),
+		       getpagesize());
 
 	if (sdp->bsize < sdp->dinfo.logical_block_size) {
 		die( _("Error: Block size %d is less than minimum logical "
@@ -370,6 +382,8 @@ static void verify_arguments(struct gfs2_sbd *sdp)
 		test_locking(sdp->lockproto, sdp->locktable);
 	if (sdp->expert) {
 		if (GFS2_EXP_MIN_RGSIZE > sdp->rgsize || sdp->rgsize > GFS2_MAX_RGSIZE)
+			/* Translators: gfs2 file systems are split into equal sized chunks called
+			   resource groups. We're checking that the user gave a valid size for them. */
 			die( _("bad resource group size\n"));
 	} else {
 		if (GFS2_MIN_RGSIZE > sdp->rgsize || sdp->rgsize > GFS2_MAX_RGSIZE)
@@ -508,6 +522,7 @@ print_results(struct gfs2_sbd *sdp, uint64_t real_device_size,
 
 	printf("%-27s%u\n", _("Block size:"), sdp->bsize);
 	printf("%-27s%.2f %s (%llu %s)\n", _("Device size:"),
+	       /* Translators: "GB" here means "gigabytes" */
 	       real_device_size / ((float)(1 << 30)), _("GB"),
 	       (unsigned long long)real_device_size / sdp->bsize, _("blocks"));
 	printf("%-27s%.2f %s (%llu %s)\n", _("Filesystem size:"),
@@ -521,7 +536,7 @@ print_results(struct gfs2_sbd *sdp, uint64_t real_device_size,
 	if (sdp->debug) {
 		printf("\n%-27s%u\n", _("Writes:"), sdp->writes);
 	}
-
+	/* Translators: "UUID" = universally unique identifier. */
 	printf("%-27s%s\n\n", _("UUID:"), str_uuid(uuid));
 }
 
@@ -547,7 +562,8 @@ static int is_symlink(char *path, char **abspath)
 		perror(_("Could not find the absolute path of the device"));
 		exit(EXIT_FAILURE);
 	}
-	printf( _("%s is a symlink to %s\n"), path, *abspath);
+	/* Translators: Example: "/dev/vg/lv is a symbolic link to /dev/dm-2" */
+	printf( _("%s is a symbolic link to %s\n"), path, *abspath);
 	return 1;
 }
 
@@ -631,7 +647,7 @@ void main_mkfs(int argc, char *argv[])
 	verify_bsize(sdp);
 
 	if (compute_constants(sdp)) {
-		perror(_("Bad constants (1)"));
+		perror(_("Failed to compute file system constants"));
 		exit(EXIT_FAILURE);
 	}
 
@@ -668,34 +684,40 @@ void main_mkfs(int argc, char *argv[])
 	build_sb(sdp, uuid);
 	error = build_jindex(sdp);
 	if (error) {
-		perror(_("Error building jindex"));
+		/* Translators: "jindex" is the name of a special file */
+		perror(_("Error building 'jindex'"));
 		exit(EXIT_FAILURE);
 	}
 	error = build_per_node(sdp);
 	if (error) {
+		/* Translators: "per-node" is the name of a special directory */
 		perror(_("Error building per-node directory"));
 		exit(EXIT_FAILURE);
 	}
 	error = build_inum(sdp);
 	if (error) {
-		perror(_("Error building inum inode"));
+		/* Translators: "inum" here is the name of a special file */
+		perror(_("Error building 'inum'"));
 		exit(EXIT_FAILURE);
 	}
 	gfs2_lookupi(sdp->master_dir, "inum", 4, &sdp->md.inum);
 	error = build_statfs(sdp);
 	if (error) {
-		perror(_("Error building statfs inode"));
+		/* Translators: "statfs" is the name of a special file */
+		perror(_("Error building 'statfs'"));
 		exit(EXIT_FAILURE);
 	}
 	gfs2_lookupi(sdp->master_dir, "statfs", 6, &sdp->md.statfs);
 	error = build_rindex(sdp);
 	if (error) {
-		perror(_("Error building rindex inode"));
+		/* Translators: "rindex" is the name of a special file */
+		perror(_("Error building 'rindex'"));
 		exit(EXIT_FAILURE);
 	}
 	error = build_quota(sdp);
 	if (error) {
-		perror(_("Error building quota inode"));
+		/* Translators: "quota" is the name of a special file */
+		perror(_("Error building 'quota'"));
 		exit(EXIT_FAILURE);
 	}
 
diff --git a/po/Makevars b/po/Makevars
index 5c753bf..e897a02 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_ --add-comments=Translators:
 
 # 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


More information about the cluster-commits mailing list