Whamcloud - gitweb
Fix e2fsprogs messages for grammar and consistency, based on suggestions
authorTheodore Ts'o <tytso@mit.edu>
Mon, 20 Jun 2005 12:35:27 +0000 (08:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 20 Jun 2005 12:35:27 +0000 (08:35 -0400)
from Benno Schulenberg.

Add missing _() so all strings can be internationalized.

e2fsck/ChangeLog
e2fsck/unix.c
misc/ChangeLog
misc/badblocks.c
misc/dumpe2fs.c
misc/findsuper.c
misc/mke2fs.c
misc/partinfo.c
misc/tune2fs.c

index ff24b42..9320c25 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-20  Theodore Ts'o  <tytso@mit.edu>
+
+       * unix.c (usage, parse_extended_opts): Clean up messages printed
+               by e2fsck for grammer and consistency.
+
 2005-06-19  Theodore Ts'o  <tytso@mit.edu>
 
        * e2fsck.8.in: Make it clear that the -c, -l, and -L options are
index 2b6e476..1d74929 100644 (file)
@@ -73,7 +73,7 @@ static void usage(e2fsck_t ctx)
        fprintf(stderr,
                _("Usage: %s [-panyrcdfvstDFSV] [-b superblock] [-B blocksize]\n"
                "\t\t[-I inode_buffer_blocks] [-P process_inode_size]\n"
-               "\t\t[-l|-L bad_blocks_file] [-C fd] [-j ext-journal]\n"
+               "\t\t[-l|-L bad_blocks_file] [-C fd] [-j external_journal]\n"
                "\t\t[-E extended-options] device\n"),
                ctx->program_name);
 
@@ -87,7 +87,7 @@ static void usage(e2fsck_t ctx)
                " -v                   Be verbose\n"
                " -b superblock        Use alternative superblock\n"
                " -B blocksize         Force blocksize when looking for superblock\n"
-               " -j external-journal  Set location of the external journal\n"
+               " -j external_journal  Set location of the external journal\n"
                " -l bad_blocks_file   Add to badblocks list\n"
                " -L bad_blocks_file   Set badblocks list\n"
                ));
@@ -529,15 +529,18 @@ static void parse_extended_opts(e2fsck_t ctx, const char *opts)
                                continue;
                        }
                        ctx->ext_attr_ver = ea_ver;
-               } else
+               } else {
+                       fprintf(stderr, _("Unknown extended option: %s\n"),
+                               token);
                        extended_usage++;
+               }
        }
        if (extended_usage) {
-               fprintf(stderr, _("Extended options are separated by commas, "
-                       "and may take an argument which\n"
-                       "is set off by an equals ('=') sign.  "
-                       "Valid raid options are:\n"
-                       "\tea_ver=<ea_version (1 or 2)\n\n"));
+               fputs(("\nExtended options are separated by commas, "
+                      "and may take an argument which\n"
+                      "is set off by an equals ('=') sign.  "
+                       "Valid extended options are:\n"
+                      "\tea_ver=<ea_version (1 or 2)>\n\n"), stderr);
                exit(1);
        }
 }      
index d6cedee..57f0b49 100644 (file)
@@ -1,5 +1,17 @@
 2005-06-20  Theodore Ts'o  <tytso@mit.edu>
 
+       * partinfo.c: Add ioctl definition for BLKGETSIZE so it can be
+               compiled cleanly.
+
+       * findsuper.c: Fix up comments for grammar.
+
+       * dumpe2fs.c (print_journal_information), partinfo.c (main): Add
+               missing _() so all strings can be internationalized.
+
+       * badblocks.c (main), mke2fs.c (parse_extended_opts, PRS),
+               partinfo.c (main), tune2fs.c (usage): Clean up printed
+               messages for grammar and consistency.
+
        * e2image.8.in: Clean up e2image man page, mostly based on
                suggestions from Benno Schulenberg.
 
index 9a6acdf..e82648f 100644 (file)
@@ -1047,7 +1047,7 @@ int main (int argc, char ** argv)
        errcode = ext2fs_badblocks_list_create(&bb_list,0);
        if (errcode) {
                com_err (program_name, errcode,
-                        _("creating in-memory bad blocks list"));
+                        _("while creating in-memory bad blocks list"));
                exit (1);
        }
 
@@ -1062,7 +1062,7 @@ int main (int argc, char ** argv)
                                default:
                                        errcode = ext2fs_badblocks_list_add(bb_list,next_bad);
                                        if (errcode) {
-                                               com_err (program_name, errcode, _("adding to in-memory bad block list"));
+                                               com_err (program_name, errcode, _("while adding to in-memory bad block list"));
                                                exit (1);
                                        }
                                        continue;
index 73042fa..b6995fd 100644 (file)
@@ -257,7 +257,7 @@ static void print_journal_information(ext2_filsys fs)
        for (i=0; i < ntohl(jsb->s_nr_users); i++) {
                uuid_unparse(&jsb->s_users[i*16], str);
                printf(i ? "                          %s\n"
-                      : "Journal users:            %s\n",
+                      : _("Journal users:            %s\n"),
                       str);
        }
 }
index 8fb163b..620f775 100644 (file)
  * Documentation addendum added by Andreas dwguest@win.tue.nl/aeb@cwi.nl
  * 
  * The program findsuper is a utility that scans a disk and finds
- * copies of ext2 superblocks (by checking for the ext2 signature
+ * copies of ext2 superblocks (by checking for the ext2 signature).
  * 
  * For each superblock found, it prints the offset in bytes, the
- * offset in 1024-byte blocks, the size of ext2 partition in fs
+ * offset in 1024-byte blocks, the size of the ext2 partition in fs
  * blocks, the filesystem blocksize (in bytes), the block group number
  * (always 0 for older ext2 systems), and a timestamp (s_mtime).
  * 
index 4c93c9f..49689c3 100644 (file)
@@ -871,10 +871,10 @@ static void parse_extended_opts(struct ext2_super_block *param,
        }
        if (r_usage) {
                fprintf(stderr, _("\nBad options specified.\n\n"
-                       "Options are separated by commas, "
+                       "Extended options are separated by commas, "
                        "and may take an argument which\n"
                        "\tis set off by an equals ('=') sign.\n\n"
-                       "Valid raid options are:\n"
+                       "Valid extended options are:\n"
                        "\tstride=<stride length in blocks>\n"
                        "\tresize=<resize maximum size in blocks>\n\n"));
                exit(1);
@@ -1005,7 +1005,7 @@ static void PRS(int argc, char *argv[])
                        if (size < EXT2_MIN_BLOCK_SIZE ||
                            size > EXT2_MAX_BLOCK_SIZE || *tmp) {
                                com_err(program_name, 0,
-                                       _("bad fragment size - %s"),
+                                       _("invalid fragment size - %s"),
                                        optarg);
                                exit(1);
                        }
@@ -1033,7 +1033,7 @@ static void PRS(int argc, char *argv[])
                            inode_ratio > EXT2_MAX_BLOCK_SIZE * 1024 ||
                            *tmp) {
                                com_err(program_name, 0,
-                                       _("bad inode ratio %s (min %d/max %d)"),
+                                       _("invalid inode ratio %s (min %d/max %d)"),
                                        optarg, EXT2_MIN_BLOCK_SIZE,
                                        EXT2_MAX_BLOCK_SIZE);
                                exit(1);
@@ -1061,7 +1061,7 @@ static void PRS(int argc, char *argv[])
                        reserved_ratio = strtoul(optarg, &tmp, 0);
                        if (reserved_ratio > 50 || *tmp) {
                                com_err(program_name, 0,
-                                       _("bad reserved blocks percent - %s"),
+                                       _("invalid reserved blocks percent - %s"),
                                        optarg);
                                exit(1);
                        }
@@ -1093,7 +1093,7 @@ static void PRS(int argc, char *argv[])
                        inode_size = strtoul(optarg, &tmp, 0);
                        if (*tmp) {
                                com_err(program_name, 0,
-                                       _("bad inode size - %s"), optarg);
+                                       _("invalid inode size - %s"), optarg);
                                exit(1);
                        }
                        break;
@@ -1212,9 +1212,9 @@ static void PRS(int argc, char *argv[])
        }
        if ((blocksize > 4096) &&
            (param.s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
-               fprintf(stderr, "\nWarning: some 2.4 kernels do not support "
-                       "blocksizes greater than 4096 \n\tusing ext3."
-                       "  Use -b 4096 if this is an issue for you.\n\n");
+               fprintf(stderr, _("\nWarning: some 2.4 kernels do not support "
+                       "blocksizes greater than 4096\n\tusing ext3.  "
+                       "Use -b 4096 if this is an issue for you.\n\n"));
 
        if (optind < argc) {
                param.s_blocks_count = parse_num_blocks(argv[optind++], 
@@ -1357,7 +1357,7 @@ static void PRS(int argc, char *argv[])
                    inode_size > EXT2_BLOCK_SIZE(&param) ||
                    inode_size & (inode_size - 1)) {
                        com_err(program_name, 0,
-                               _("bad inode size %d (min %d/max %d)"),
+                               _("invalid inode size %d (min %d/max %d)"),
                                inode_size, EXT2_GOOD_OLD_INODE_SIZE,
                                blocksize);
                        exit(1);
index 9363149..f1ec879 100644 (file)
@@ -9,6 +9,9 @@
 
 #include <sys/types.h>
 #include <fcntl.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
 #include <stdio.h>
 #include <linux/hdreg.h>
 #include <unistd.h>
 #include <errno.h>
 #include "nls-enable.h"
 
+#if defined(__linux__) && defined(_IO) && !defined(BLKGETSIZE)
+#define BLKGETSIZE _IO(0x12,96)        /* return device size */
+#endif
+
 void print_error(char *operation, int error, char *device)
 {
        fprintf(stderr, _("%s failed for %s: %s\n"), operation, device,
@@ -35,11 +42,9 @@ int main(int argc, char **argv)
        textdomain(NLS_CAT_NAME);
 #endif
        if (argc == 1) {
-               fprintf(stderr, _("Usage: %s <dev1> <dev2> <dev3>\n\n"
-                       "This program prints out the partition information "
-                       "for a set of devices\n"
-                       "A common way to use this program is:\n\n\t"
-                       "%s /dev/hda?\n\n"), argv[0], argv[0]);
+               fprintf(stderr, _("Usage:  %s device...\n\nPrints out the"
+                       "partition information for each given device.\n"),
+                       "For example: %s /dev/hda\n\n", argv[0], argv[0]);
                exit(1);
        }
     
@@ -47,7 +52,7 @@ int main(int argc, char **argv)
                fd = open(argv[i], O_RDONLY);
 
                if (fd < 0) {
-                       print_error("open", errno, argv[i]);
+                       print_error(_("open"), errno, argv[i]);
                        continue;
                }
     
index 8385187..15bfd44 100644 (file)
@@ -81,14 +81,14 @@ void do_findfs(int argc, char **argv);
 static void usage(void)
 {
        fprintf(stderr,
-               _("Usage: %s [-c max-mounts-count] [-e errors-behavior] "
+               _("Usage: %s [-c max_mounts_count] [-e errors_behavior] "
                  "[-g group]\n"
-                 "\t[-i interval[d|m|w]] [-j] [-J journal-options]\n"
-                 "\t[-l] [-s sparse-flag] [-m reserved-blocks-percent]\n"
-                 "\t[-o [^]mount-options[,...]] [-r reserved-blocks-count]\n"
-                 "\t[-u user] [-C mount-count] [-L volume-label] "
-                 "[-M last-mounted-dir]\n"
-                 "\t[-O [^]feature[,...]] [-T last-check-time] [-U UUID]"
+                 "\t[-i interval[d|m|w]] [-j] [-J journal_options]\n"
+                 "\t[-l] [-s sparse_flag] [-m reserved_blocks_percent]\n"
+                 "\t[-o [^]mount_options[,...]] [-r reserved_blocks_count]\n"
+                 "\t[-u user] [-C mount_count] [-L volume_label] "
+                 "[-M last_mounted_dir]\n"
+                 "\t[-O [^]feature[,...]] [-T last_check_time] [-U UUID]"
                  " device\n"), program_name);
        exit (1);
 }