summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/ChangeLog6
-rw-r--r--misc/badblocks.c97
-rw-r--r--misc/chattr.c36
-rw-r--r--misc/dumpe2fs.c40
-rw-r--r--misc/e2label.c17
-rw-r--r--misc/findsuper.c18
-rw-r--r--misc/fsck.c52
-rw-r--r--misc/get_device_by_label.c3
-rw-r--r--misc/lsattr.c16
-rw-r--r--misc/mke2fs.c193
-rw-r--r--misc/mklost+found.c10
-rw-r--r--misc/nls-enable.h17
-rw-r--r--misc/partinfo.c18
-rw-r--r--misc/tune2fs.c88
-rw-r--r--misc/uuidgen.c3
15 files changed, 359 insertions, 255 deletions
diff --git a/misc/ChangeLog b/misc/ChangeLog
index 2f530839..4a212770 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,5 +1,11 @@
2000-02-06 Theodore Ts'o <tytso@valinux.com>
+ * badblocks.c, chattr.c, dumpe2fs.c, e2label.c, findsuper.c,
+ fsck.c, get_device_by_label.c, lsattr.c, mke2fs.c,
+ mklost+found.c, nls-enable.h, partinfo.c, tune2fs.c,
+ uuidgen.c: Add Internationalization support as
+ suggested by Marco d'Itri <md@linux.it>.
+
* badblocks.c: Fix non-destructive read/write patches from David
Beattie. Non-standard variable-length automatic arrays
removed. Non-destrutive write test fixed so that logic is
diff --git a/misc/badblocks.c b/misc/badblocks.c
index f687fe79..6057115e 100644
--- a/misc/badblocks.c
+++ b/misc/badblocks.c
@@ -52,9 +52,10 @@
#include "ext2fs/ext2_io.h"
#include <linux/ext2_fs.h>
#include "ext2fs/ext2fs.h"
+#include "nls-enable.h"
const char * program_name = "badblocks";
-const char * done_string = "done \n";
+const char * done_string = _("done \n");
int v_flag = 0; /* verbose */
int w_flag = 0; /* do r/w test: 0=no, 1=yes, 2=non-destructive */
@@ -62,7 +63,7 @@ int s_flag = 0; /* show progress of test */
static void usage(void)
{
- fprintf (stderr, "Usage: %s [-b block_size] [-i input_file] [-o output_file] [-svwn]\n [-c blocks_at_once] [-p num_passes] device blocks_count [start_count]\n",
+ fprintf(stderr, _("Usage: %s [-b block_size] [-i input_file] [-o output_file] [-svwn]\n [-c blocks_at_once] [-p num_passes] device blocks_count [start_count]\n"),
program_name);
exit (1);
}
@@ -155,15 +156,14 @@ static long do_read (int dev, char * buffer, int try, int block_size,
/* Seek to the correct loc. */
if (ext2fs_llseek (dev, (ext2_loff_t) current_block * block_size,
SEEK_SET) != (ext2_loff_t) current_block * block_size)
- com_err (program_name, errno, "during seek");
+ com_err (program_name, errno, _("during seek"));
/* Try the read */
got = read (dev, buffer, try * block_size);
if (got < 0)
got = 0;
if (got & 511)
- fprintf (stderr,
- "Weird value (%ld) in do_read\n", got);
+ fprintf(stderr, _("Weird value (%ld) in do_read\n"), got);
got /= block_size;
return got;
}
@@ -183,7 +183,7 @@ static long do_write (int dev, char * buffer, int try, int block_size,
/* Seek to the correct loc. */
if (ext2fs_llseek (dev, (ext2_loff_t) current_block * block_size,
SEEK_SET) != (ext2_loff_t) current_block * block_size)
- com_err (program_name, errno, "during seek");
+ com_err (program_name, errno, _("during seek"));
/* Try the write */
got = write (dev, buffer, try * block_size);
@@ -205,10 +205,10 @@ static void flush_bufs (int dev, int sync)
&& sync
#endif
)
- fprintf (stderr, "Flushing buffers\n");
+ fprintf (stderr, _("Flushing buffers\n"));
if (sync && fdatasync (dev) == -1)
- com_err (program_name, errno, "during fsync");
+ com_err (program_name, errno, _("during fsync"));
#ifdef BLKFLSBUF
ioctl (host_dev, BLKFLSBUF, 0); /* In case this is a HD */
@@ -230,7 +230,8 @@ static unsigned int test_ro (int dev, unsigned long blocks_count,
errcode = ext2fs_badblocks_list_iterate_begin(bb_list,&bb_iter);
if (errcode) {
- com_err (program_name, errcode, "while beginning bad block list iteration");
+ com_err (program_name, errcode,
+ _("while beginning bad block list iteration"));
exit (1);
}
do {
@@ -240,20 +241,21 @@ static unsigned int test_ro (int dev, unsigned long blocks_count,
blkbuf = malloc (blocks_at_once * block_size);
if (!blkbuf)
{
- com_err (program_name, ENOMEM, "while allocating buffers");
+ com_err (program_name, ENOMEM, _("while allocating buffers"));
exit (1);
}
flush_bufs (dev, 0);
if (v_flag) {
- fprintf (stderr,
- "Checking for bad blocks in read-only mode\n");
- fprintf (stderr, "From block %lu to %lu\n", from_count, blocks_count);
+ fprintf(stderr, _("Checking for bad blocks in read-only mode\n"));
+ fprintf (stderr, _("From block %lu to %lu\n"), from_count,
+ blocks_count);
}
try = blocks_at_once;
currently_testing = from_count;
num_blocks = blocks_count;
if (s_flag || v_flag > 1) {
- fprintf(stderr, "Checking for bad blocks (read-only test): ");
+ fprintf(stderr,
+ _("Checking for bad blocks (read-only test): "));
if (v_flag <= 1)
alarm_intr(SIGALRM);
}
@@ -308,7 +310,7 @@ static unsigned int test_rw (int dev, unsigned long blocks_count,
buffer = malloc (2 * block_size);
if (!buffer)
{
- com_err (program_name, ENOMEM, "while allocating buffers");
+ com_err (program_name, ENOMEM, _("while allocating buffers"));
exit (1);
}
@@ -316,14 +318,14 @@ static unsigned int test_rw (int dev, unsigned long blocks_count,
if (v_flag) {
fprintf(stderr,
- "Checking for bad blocks in read-write mode\n");
- fprintf(stderr, "From block %lu to %lu\n",
+ _("Checking for bad blocks in read-write mode\n"));
+ fprintf(stderr, _("From block %lu to %lu\n"),
from_count, blocks_count);
}
for (i = 0; i < sizeof (pattern); i++) {
memset (buffer, pattern[i], block_size);
if (s_flag | v_flag)
- fprintf (stderr, "Writing pattern 0x%08x: ",
+ fprintf (stderr, _("Writing pattern 0x%08x: "),
*((int *) buffer));
num_blocks = blocks_count;
currently_testing = from_count;
@@ -337,7 +339,7 @@ static unsigned int test_rw (int dev, unsigned long blocks_count,
block_size, SEEK_SET) !=
(ext2_loff_t) currently_testing * block_size)
com_err (program_name, errno,
- "during seek on block %d",
+ _("during seek on block %d"),
currently_testing);
if (v_flag > 1)
print_status();
@@ -349,7 +351,7 @@ static unsigned int test_rw (int dev, unsigned long blocks_count,
fprintf(stderr, done_string);
flush_bufs (dev, 1);
if (s_flag | v_flag)
- fprintf (stderr, "Reading and comparing: ");
+ fprintf (stderr, _("Reading and comparing: "));
num_blocks = blocks_count;
currently_testing = from_count;
if (s_flag && v_flag <= 1)
@@ -362,7 +364,7 @@ static unsigned int test_rw (int dev, unsigned long blocks_count,
block_size, SEEK_SET) !=
(ext2_loff_t) currently_testing * block_size)
com_err (program_name, errno,
- "during seek on block %d",
+ _("during seek on block %d"),
currently_testing);
if (v_flag > 1)
print_status();
@@ -403,7 +405,7 @@ static unsigned int test_nd (int dev, unsigned long blocks_count,
errcode = ext2fs_badblocks_list_iterate_begin(bb_list,&bb_iter);
if (errcode) {
com_err (program_name, errcode,
- "while beginning bad block list iteration");
+ _("while beginning bad block list iteration"));
exit (1);
}
do {
@@ -414,13 +416,13 @@ static unsigned int test_nd (int dev, unsigned long blocks_count,
bufblk = malloc (blocks_at_once * sizeof(unsigned long));
bufblks = malloc (blocks_at_once * sizeof(unsigned long));
if (!blkbuf || !bufblk || !bufblks) {
- com_err (program_name, ENOMEM, "while allocating buffers");
+ com_err(program_name, ENOMEM, _("while allocating buffers"));
exit (1);
}
/* inititalize the test data randomly: */
if (v_flag) {
- fprintf (stderr, "Initializing random test data\n");
+ fprintf (stderr, _("Initializing random test data\n"));
}
for(ptr = blkbuf + blocks_at_once * block_size;
ptr < blkbuf + 2 * blocks_at_once * block_size;
@@ -431,11 +433,11 @@ static unsigned int test_nd (int dev, unsigned long blocks_count,
flush_bufs (dev, 0);
if (v_flag) {
fprintf (stderr,
- "Checking for bad blocks in non-destructive read-write mode\n");
- fprintf (stderr, "From block %lu to %lu\n", from_count, blocks_count);
+ _("Checking for bad blocks in non-destructive read-write mode\n"));
+ fprintf (stderr, _("From block %lu to %lu\n"), from_count, blocks_count);
}
if (s_flag || v_flag > 1) {
- fprintf (stderr, "Checking for bad blocks (non-destructive read-write test): ");
+ fprintf(stderr, _("Checking for bad blocks (non-destructive read-write test): "));
if (v_flag <= 1)
alarm_intr(SIGALRM);
}
@@ -474,7 +476,7 @@ static unsigned int test_nd (int dev, unsigned long blocks_count,
currently_testing);
if (written != got)
com_err (program_name, errno,
- "during test data write, block %lu",
+ _("during test data write, block %lu"),
currently_testing + written);
}
@@ -558,7 +560,7 @@ static unsigned int test_nd (int dev, unsigned long blocks_count,
num_blocks = 0;
alarm(0);
if (s_flag || v_flag > 1)
- fprintf(stderr, "done \n");
+ fprintf(stderr, done_string);
} else {
/* abnormal termination by a signal is handled here */
@@ -567,7 +569,7 @@ static unsigned int test_nd (int dev, unsigned long blocks_count,
abort. */
long buf_written;
- fprintf(stderr, "Interrupt caught, cleaning up\n");
+ fprintf(stderr, _("Interrupt caught, cleaning up\n"));
for (buf_written = 0;
buf_written < buf_used;
@@ -609,6 +611,11 @@ int main (int argc, char ** argv)
setbuf(stdout, NULL);
setbuf(stderr, NULL);
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
if (argc && *argv)
program_name = *argv;
while ((c = getopt (argc, argv, "b:i:o:svwnc:p:h:")) != EOF) {
@@ -617,7 +624,7 @@ int main (int argc, char ** argv)
block_size = strtoul (optarg, &tmp, 0);
if (*tmp || block_size > 4096) {
com_err (program_name, 0,
- "bad block size - %s", optarg);
+ _("bad block size - %s"), optarg);
exit (1);
}
break;
@@ -671,21 +678,22 @@ int main (int argc, char ** argv)
blocks_count = strtoul (argv[optind], &tmp, 0);
if (*tmp)
{
- com_err (program_name, 0, "bad blocks count - %s", argv[optind]);
+ com_err (program_name, 0, _("bad blocks count - %s"),
+ argv[optind]);
exit (1);
}
if (++optind <= argc-1) {
from_count = strtoul (argv[optind], &tmp, 0);
} else from_count = 0;
if (from_count >= blocks_count) {
- com_err (program_name, 0, "bad blocks range: %lu-%lu",
+ com_err (program_name, 0, _("bad blocks range: %lu-%lu"),
from_count, blocks_count);
exit (1);
}
dev = open (device_name, w_flag ? O_RDWR : O_RDONLY);
if (dev == -1)
{
- com_err (program_name, errno, "while trying to open %s",
+ com_err (program_name, errno, _("while trying to open %s"),
device_name);
exit (1);
}
@@ -693,8 +701,9 @@ int main (int argc, char ** argv)
host_dev = open (host_device_name, O_RDONLY);
if (host_dev == -1)
{
- com_err (program_name, errno, "while trying to open %s",
- host_device_name);
+ com_err (program_name, errno,
+ _("while trying to open %s"),
+ host_device_name);
exit (1);
}
} else
@@ -706,7 +715,8 @@ int main (int argc, char ** argv)
in = fopen (input_file, "r");
if (in == NULL)
{
- com_err (program_name, errno,"while trying to open %s",
+ com_err (program_name, errno,
+ _("while trying to open %s"),
input_file);
exit (1);
}
@@ -716,7 +726,8 @@ int main (int argc, char ** argv)
out = fopen (output_file, "w");
if (out == NULL)
{
- com_err (program_name, errno,"while trying to open %s",
+ com_err (program_name, errno,
+ _("while trying to open %s"),
output_file);
exit (1);
}
@@ -726,7 +737,8 @@ 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");
+ com_err (program_name, errcode,
+ _("creating in-memory bad blocks list"));
exit (1);
}
@@ -741,7 +753,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, _("adding to in-memory bad block list"));
exit (1);
}
continue;
@@ -766,7 +778,9 @@ int main (int argc, char ** argv)
) ? passes_clean = 0 : ++passes_clean;
if (v_flag)
- fprintf(stderr,"Pass completed, %u bad blocks found.\n", bb_count);
+ fprintf(stderr,
+ _("Pass completed, %u bad blocks found.\n"),
+ bb_count);
} while (passes_clean < num_passes);
@@ -775,3 +789,4 @@ int main (int argc, char ** argv)
fclose (out);
return 0;
}
+
diff --git a/misc/chattr.c b/misc/chattr.c
index de1480c7..fd5210a6 100644
--- a/misc/chattr.c
+++ b/misc/chattr.c
@@ -44,6 +44,7 @@
#include "e2p/e2p.h"
#include "../version.h"
+#include "nls-enable.h"
const char * program_name = "chattr";
@@ -67,7 +68,7 @@ static void fatal_error(const char * fmt_string, int errcode)
exit (errcode);
}
-#define usage() fatal_error("usage: %s [-RV] [-+=AacdisSu] [-v version] files...\n", \
+#define usage() fatal_error(_("usage: %s [-RV] [-+=AacdisSu] [-v version] files...\n"), \
1)
static int decode_arg (int * i, int argc, char ** argv)
@@ -135,13 +136,13 @@ static int decode_arg (int * i, int argc, char ** argv)
if (*tmp)
{
com_err (program_name, 0,
- "bad version - %s\n", argv[*i]);
+ _("bad version - %s\n"), argv[*i]);
usage ();
}
set_version = 1;
break;
default:
- fprintf (stderr, "%s: Unrecognized argument: %c\n",
+ fprintf (stderr, _("%s: Unrecognized argument: %c\n"),
program_name, *p);
usage ();
}
@@ -244,7 +245,7 @@ static void change_attributes (const char * name)
if (lstat (name, &st) == -1)
{
- com_err (program_name, errno, "while stating %s", name);
+ com_err (program_name, errno, _("while stating %s"), name);
return;
}
if (S_ISLNK(st.st_mode) && recursive)
@@ -253,7 +254,7 @@ static void change_attributes (const char * name)
{
if (verbose)
{
- printf ("Flags of %s set as ", name);
+ printf (_("Flags of %s set as "), name);
print_flags (stdout, sf, 0);
printf ("\n");
}
@@ -264,7 +265,7 @@ static void change_attributes (const char * name)
{
if (fgetflags (name, &flags) == -1)
com_err (program_name, errno,
- "while reading flags on %s", name);
+ _("while reading flags on %s"), name);
else
{
if (rem)
@@ -273,22 +274,22 @@ static void change_attributes (const char * name)
flags |= af;
if (verbose)
{
- printf ("Flags of %s set as ", name);
+ printf (_("Flags of %s set as "), name);
print_flags (stdout, flags, 0);
printf ("\n");
}
if (fsetflags (name, flags) == -1)
com_err (program_name, errno,
- "while setting flags on %s", name);
+ _("while setting flags on %s"), name);
}
}
if (set_version)
{
if (verbose)
- printf ("Version of %s set as %lu\n", name, version);
+ printf (_("Version of %s set as %lu\n"), name, version);
if (fsetversion (name, version) == -1)
com_err (program_name, errno,
- "while setting version on %s", name);
+ _("while setting version on %s"), name);
}
if (S_ISDIR(st.st_mode) && recursive)
iterate_on_dir (name, chattr_dir_proc, (void *) NULL);
@@ -302,8 +303,8 @@ static int chattr_dir_proc (const char * dir_name, struct dirent * de, void * pr
path = malloc(strlen (dir_name) + 1 + strlen (de->d_name) + 1);
if (!path)
- fatal_error("Couldn't allocate path variable "
- "in chattr_dir_proc", 1);
+ fatal_error(_("Couldn't allocate path variable "
+ "in chattr_dir_proc"), 1);
sprintf (path, "%s/%s", dir_name, de->d_name);
change_attributes (path);
free(path);
@@ -316,6 +317,11 @@ int main (int argc, char ** argv)
int i, j;
int end_arg = 0;
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
if (argc && *argv)
program_name = *argv;
i = 1;
@@ -330,16 +336,16 @@ int main (int argc, char ** argv)
usage ();
if (set && (add || rem))
{
- fprintf (stderr, "= is incompatible with - and +\n");
+ fprintf (stderr, _("= is incompatible with - and +\n"));
exit (1);
}
if (!(add || rem || set || set_version))
{
- fprintf (stderr, "Must use '-v', =, - or +\n");
+ fprintf (stderr, _("Must use '-v', =, - or +\n"));
exit (1);
}
if (verbose)
- fprintf (stderr, "chattr %s, %s for EXT2 FS %s, %s\n",
+ fprintf (stderr, _("chattr %s, %s for EXT2 FS %s, %s\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE,
EXT2FS_VERSION, EXT2FS_DATE);
for (j = i; j < argc; j++)
diff --git a/misc/dumpe2fs.c b/misc/dumpe2fs.c
index da025120..90561290 100644
--- a/misc/dumpe2fs.c
+++ b/misc/dumpe2fs.c
@@ -35,6 +35,7 @@
#include "e2p/e2p.h"
#include "../version.h"
+#include "nls-enable.h"
#define in_use(m, x) (ext2fs_test_bit ((x), (m)))
@@ -43,8 +44,8 @@ char * device_name = NULL;
static void usage(void)
{
- fprintf (stderr, "usage: %s [-bV] [-ob superblock] "
- "[-oB blocksize] device\n", program_name);
+ fprintf (stderr, _("Usage: %s [-bV] [-ob superblock] "
+ "[-oB blocksize] device\n"), program_name);
exit (1);
}
@@ -88,27 +89,27 @@ static void list_desc (ext2_filsys fs)
next_blk = group_blk + fs->super->s_blocks_per_group;
if (next_blk > fs->super->s_blocks_count)
next_blk = fs->super->s_blocks_count;
- printf ("Group %lu: (Blocks %u -- %u)\n", i,
+ printf (_("Group %lu: (Blocks %u -- %u)\n"), i,
group_blk, next_blk -1 );
- printf (" Block bitmap at %u (+%d), "
+ printf (_(" Block bitmap at %u (+%d), "
"Inode bitmap at %u (+%d)\n "
- "Inode table at %u (+%d)\n",
+ "Inode table at %u (+%d)\n"),
fs->group_desc[i].bg_block_bitmap,
fs->group_desc[i].bg_block_bitmap - group_blk,
fs->group_desc[i].bg_inode_bitmap,
fs->group_desc[i].bg_inode_bitmap - group_blk,
fs->group_desc[i].bg_inode_table,
fs->group_desc[i].bg_inode_table - group_blk);
- printf (" %d free blocks, %d free inodes, %d directories\n",
+ printf (_(" %d free blocks, %d free inodes, %d directories\n"),
fs->group_desc[i].bg_free_blocks_count,
fs->group_desc[i].bg_free_inodes_count,
fs->group_desc[i].bg_used_dirs_count);
- printf (" Free blocks: ");
+ printf (_(" Free blocks: "));
print_free (i, block_bitmap, fs->super->s_blocks_per_group,
fs->super->s_first_data_block);
block_bitmap += fs->super->s_blocks_per_group / 8;
printf ("\n");
- printf (" Free inodes: ");
+ printf (_(" Free inodes: "));
print_free (i, inode_bitmap, fs->super->s_inodes_per_group, 1);
inode_bitmap += fs->super->s_inodes_per_group / 8;
printf ("\n");
@@ -131,11 +132,11 @@ static void list_bad_blocks(ext2_filsys fs)
retval = badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("badblocks_list_iterate_begin", retval,
- "while printing bad block list");
+ _("while printing bad block list"));
exit(1);
}
if (badblocks_list_iterate(bb_iter, &blk))
- printf("Bad blocks: %d", blk);
+ printf(_("Bad blocks: %d"), blk);
while (badblocks_list_iterate(bb_iter, &blk))
printf(", %d", blk);
badblocks_list_iterate_end(bb_iter);
@@ -157,7 +158,7 @@ static void dump_bad_blocks(ext2_filsys fs)
retval = badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("badblocks_list_iterate_begin", retval,
- "while printing bad block list");
+ _("while printing bad block list"));
exit(1);
}
while (badblocks_list_iterate(bb_iter, &blk))
@@ -185,8 +186,13 @@ int main (int argc, char ** argv)
int big_endian;
int c;
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
initialize_ext2_error_table();
- fprintf (stderr, "dumpe2fs %s, %s for EXT2 FS %s, %s\n",
+ fprintf (stderr, _("dumpe2fs %s, %s for EXT2 FS %s, %s\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE,
EXT2FS_VERSION, EXT2FS_DATE);
if (argc && *argv)
@@ -213,7 +219,7 @@ int main (int argc, char ** argv)
break;
case 'V':
/* Print version number and exit */
- fprintf(stderr, "\tUsing %s\n",
+ fprintf(stderr, _("\tUsing %s\n"),
error_message(EXT2_ET_BASE));
exit(0);
default:
@@ -229,9 +235,9 @@ int main (int argc, char ** argv)
use_superblock, use_blocksize,
unix_io_manager, &fs);
if (retval) {
- com_err (program_name, retval, "while trying to open %s",
+ com_err (program_name, retval, _("while trying to open %s"),
device_name);
- printf ("Couldn't find valid filesystem superblock.\n");
+ printf (_("Couldn't find valid filesystem superblock.\n"));
exit (1);
}
if (print_badblocks) {
@@ -241,7 +247,7 @@ int main (int argc, char ** argv)
if (!i386_byteorder())
big_endian = !big_endian;
if (big_endian)
- printf("Note: This is a byte-swapped filesystem\n");
+ printf(_("Note: This is a byte-swapped filesystem\n"));
list_super (fs->super);
list_bad_blocks (fs);
if (header_only) {
@@ -251,7 +257,7 @@ int main (int argc, char ** argv)
retval = ext2fs_read_bitmaps (fs);
if (retval) {
com_err (program_name, retval,
- "while trying to read the bitmaps",
+ _("while trying to read the bitmaps"),
device_name);
ext2fs_close (fs);
exit (1);
diff --git a/misc/e2label.c b/misc/e2label.c
index 8c0df8b2..477c34bf 100644
--- a/misc/e2label.c
+++ b/misc/e2label.c
@@ -29,6 +29,7 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#include "nls-enable.h"
#define EXT2_SUPER_MAGIC 0xEF53
@@ -50,21 +51,21 @@ static int open_e2fs (char *dev, int mode)
fd = open(dev, mode);
if (fd < 0) {
perror(dev);
- fprintf (stderr, "e2label: cannot open %s\n", dev);
+ fprintf (stderr, _("e2label: cannot open %s\n"), dev);
exit(1);
}
if (lseek(fd, 1024, SEEK_SET) != 1024) {
perror(dev);
- fprintf (stderr, "e2label: cannot seek to superblock\n");
+ fprintf (stderr, _("e2label: cannot seek to superblock\n"));
exit(1);
}
if (read(fd, (char *) &sb, sizeof(sb)) != sizeof(sb)) {
perror(dev);
- fprintf (stderr, "e2label: error reading superblock\n");
+ fprintf (stderr, _("e2label: error reading superblock\n"));
exit(1);
}
if (sb.s_magic[0] + 256*sb.s_magic[1] != EXT2_SUPER_MAGIC) {
- fprintf (stderr, "e2label: not an ext2 filesystem\n");
+ fprintf (stderr, _("e2label: not an ext2 filesystem\n"));
exit(1);
}
@@ -89,15 +90,15 @@ static void change_label (char *dev, char *label)
memset(sb.s_volume_name, 0, VOLNAMSZ);
strncpy(sb.s_volume_name, label, VOLNAMSZ);
if (strlen(label) > VOLNAMSZ)
- fprintf(stderr, "Warning: label too long, truncating.\n");
+ fprintf(stderr, _("Warning: label too long, truncating.\n"));
if (lseek(fd, 1024, SEEK_SET) != 1024) {
perror(dev);
- fprintf (stderr, "e2label: cannot seek to superblock again\n");
+ fprintf (stderr, _("e2label: cannot seek to superblock again\n"));
exit(1);
}
if (write(fd, (char *) &sb, sizeof(sb)) != sizeof(sb)) {
perror(dev);
- fprintf (stderr, "e2label: error writing superblock\n");
+ fprintf (stderr, _("e2label: error writing superblock\n"));
exit(1);
}
}
@@ -109,7 +110,7 @@ int main (int argc, char ** argv)
else if (argc == 3)
change_label(argv[1], argv[2]);
else {
- fprintf(stderr, "Usage: e2label device [newlabel]\n");
+ fprintf(stderr, _("Usage: e2label device [newlabel]\n"));
exit(1);
}
return 0;
diff --git a/misc/findsuper.c b/misc/findsuper.c
index 3a1ef3bd..4cca6cfc 100644
--- a/misc/findsuper.c
+++ b/misc/findsuper.c
@@ -68,6 +68,7 @@
#include <time.h>
#include <linux/ext2_fs.h>
+#include "nls-enable.h"
main(int argc, char *argv[])
@@ -82,23 +83,28 @@ main(int argc, char *argv[])
struct ext2_super_block ext2;
/* interesting fields: EXT2_SUPER_MAGIC
* s_blocks_count s_log_block_size s_mtime s_magic s_lastcheck */
-
+
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
if (argc<2) {
fprintf(stderr,
- "Usage: findsuper device [skiprate [start]]\n");
+ _("Usage: findsuper device [skiprate [start]]\n"));
exit(1);
}
if (argc>2)
skiprate=atoi(argv[2]);
if (skiprate<512) {
fprintf(stderr,
- "Do you really want to skip less than a sector??\n");
+ _("Do you really want to skip less than a sector??\n"));
exit(2);
}
if (argc>3)
sk=atol(argv[3]);
if (sk<0) {
- fprintf(stderr,"Have to start at 0 or greater,not %ld\n",sk);
+ fprintf(stderr,_("Have to start at 0 or greater,not %ld\n"),sk);
exit(1);
}
f=fopen(argv[1],"r");
@@ -111,7 +117,7 @@ main(int argc, char *argv[])
printf(" thisoff block fs_blk_sz blksz grp last_mount\n");
for (;!feof(f) && (i=fseek(f,sk,SEEK_SET))!= -1; sk+=skiprate){
if (i=fread(&ext2,sizeof(ext2),1, f)!=1) {
- perror("read failed");
+ perror(_("read failed"));
}
if (ext2.s_magic != EXT2_SUPER_MAGIC)
continue;
@@ -124,6 +130,6 @@ main(int argc, char *argv[])
ext2.s_log_block_size,
ext2.s_block_group_nr, s);
}
- printf("Failed on %d at %ld\n", i, sk);
+ printf(_("Failed on %d at %ld\n"), i, sk);
fclose(f);
}
diff --git a/misc/fsck.c b/misc/fsck.c
index 9b42820d..1e762573 100644
--- a/misc/fsck.c
+++ b/misc/fsck.c
@@ -53,6 +53,7 @@
#include <malloc.h>
#include "../version.h"
+#include "nls-enable.h"
#include "fsck.h"
#include "get_device_by_label.h"
@@ -289,7 +290,7 @@ static void load_fs_info(const char *filename)
filesys_info = NULL;
if ((f = fopen(filename, "r")) == NULL) {
- fprintf(stderr, "WARNING: couldn't open %s: %s\n",
+ fprintf(stderr, _("WARNING: couldn't open %s: %s\n"),
filename, strerror(errno));
return;
}
@@ -299,8 +300,8 @@ static void load_fs_info(const char *filename)
break;
buf[sizeof(buf)-1] = 0;
if (parse_fstab_line(buf, &fs) < 0) {
- fprintf(stderr, "WARNING: bad format "
- "on line %d of %s\n", lineno, filename);
+ fprintf(stderr, _("WARNING: bad format "
+ "on line %d of %s\n"), lineno, filename);
continue;
}
if (!fs)
@@ -320,12 +321,10 @@ static void load_fs_info(const char *filename)
fclose(f);
if (old_fstab) {
- fprintf(stderr, "\007\007\007"
- "WARNING: Your /etc/fstab does not contain the fsck passno\n");
- fprintf(stderr,
- " field. I will kludge around things for you, but you\n");
- fprintf(stderr,
- " should fix your /etc/fstab file as soon as you can.\n\n");
+ fprintf(stderr, _("\007\007\007"
+ "WARNING: Your /etc/fstab does not contain the fsck passno\n"
+ " field. I will kludge around things for you, but you\n"
+ " should fix your /etc/fstab file as soon as you can.\n\n"));
for (fs = filesys_info; fs; fs = fs->next) {
fs->passno = 1;
@@ -420,7 +419,7 @@ static int execute(const char *type, char *device, char *mntpt,
s = find_fsck(prog);
if (s == NULL) {
- fprintf(stderr, "fsck: %s: not found\n", prog);
+ fprintf(stderr, _("fsck: %s: not found\n"), prog);
return ENOENT;
}
@@ -502,7 +501,7 @@ static struct fsck_instance *wait_one(NOARGS)
continue;
if (errno == ECHILD) {
fprintf(stderr,
- "%s: wait: No more child process?!?\n",
+ _("%s: wait: No more child process?!?\n"),
progname);
return NULL;
}
@@ -524,13 +523,13 @@ static struct fsck_instance *wait_one(NOARGS)
if (sig == SIGINT) {
status = EXIT_UNCORRECTED;
} else {
- printf("Warning... %s for device %s exited "
- "with signal %d.\n",
+ printf(_("Warning... %s for device %s exited "
+ "with signal %d.\n"),
inst->prog, inst->device, sig);
status = EXIT_ERROR;
}
} else {
- printf("%s %s: status is %x, should never happen.\n",
+ printf(_("%s %s: status is %x, should never happen.\n"),
inst->prog, inst->device, status);
status = EXIT_ERROR;
}
@@ -614,8 +613,8 @@ static void fsck_device(char *device, int interactive)
retval = execute(type, device, fsent ? fsent->mountpt : 0,
interactive);
if (retval) {
- fprintf(stderr, "%s: Error %d while executing fsck.%s "
- "for %s\n", progname, retval, type, device);
+ fprintf(stderr, _("%s: Error %d while executing fsck.%s "
+ "for %s\n"), progname, retval, type, device);
}
}
@@ -677,7 +676,7 @@ static int ignore(struct fs_info *fs)
/* See if the <fsck.fs> program is available. */
if (find_fsck(fs->type) == NULL) {
if (wanted)
- fprintf(stderr, "fsck: cannot check %s: fsck.%s not found\n",
+ fprintf(stderr, _("fsck: cannot check %s: fsck.%s not found\n"),
fs->device, fs->type);
return(1);
}
@@ -733,7 +732,7 @@ static int check_all(NOARGS)
int pass_done;
if (verbose)
- printf("Checking all file systems.\n");
+ printf(_("Checking all file systems.\n"));
/*
* Find and check the root filesystem first.
@@ -798,7 +797,7 @@ static int check_all(NOARGS)
}
}
if (verbose > 1)
- printf("--waiting-- (pass %d)\n", passno);
+ printf(_("--waiting-- (pass %d)\n"), passno);
inst = wait_one();
if (inst) {
status |= inst->exit_status;
@@ -819,7 +818,7 @@ static int check_all(NOARGS)
static void usage(NOARGS)
{
fprintf(stderr,
- "Usage: fsck [-ACNPRTV] [-t fstype] [fs-options] filesys\n");
+ _("Usage: fsck [-ACNPRTV] [-t fstype] [fs-options] filesys\n"));
exit(EXIT_USAGE);
}
@@ -845,7 +844,7 @@ static void PRS(int argc, char *argv[])
(strncmp(arg, "LABEL=", 6) == 0) ||
(strncmp(arg, "UUID=", 5) == 0)) {
if (num_devices >= MAX_DEVICES) {
- fprintf(stderr, "%s: too many devices\n",
+ fprintf(stderr, _("%s: too many devices\n"),
progname);
exit(1);
}
@@ -855,7 +854,7 @@ static void PRS(int argc, char *argv[])
}
if (arg[0] != '-' || opts_for_fsck) {
if (num_args >= MAX_ARGS) {
- fprintf(stderr, "%s: too many arguments\n",
+ fprintf(stderr, _("%s: too many arguments\n"),
progname);
exit(1);
}
@@ -921,7 +920,7 @@ static void PRS(int argc, char *argv[])
options[++opt] = '\0';
if (num_args >= MAX_ARGS) {
fprintf(stderr,
- "%s: too many arguments\n",
+ _("%s: too many arguments\n"),
progname);
exit(1);
}
@@ -941,10 +940,15 @@ int main(int argc, char *argv[])
char *oldpath = getenv("PATH");
const char *fstab;
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
PRS(argc, argv);
if (!notitle)
- printf("Parallelizing fsck version %s (%s)\n",
+ printf(_("Parallelizing fsck version %s (%s)\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE);
fstab = getenv("FSTAB_FILE");
diff --git a/misc/get_device_by_label.c b/misc/get_device_by_label.c
index cfb49f59..e03e0f17 100644
--- a/misc/get_device_by_label.c
+++ b/misc/get_device_by_label.c
@@ -14,6 +14,7 @@
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
+#include "nls-enable.h"
#include "get_device_by_label.h"
#define PROC_PARTITIONS "/proc/partitions"
@@ -155,7 +156,7 @@ get_spec_by_uuid(const char *s0) {
return get_spec_by_x(UUID, uuid);
bad_uuid:
- fprintf(stderr, "WARNING: %s: bad UUID", s0);
+ fprintf(stderr, _("WARNING: %s: bad UUID"), s0);
return NULL;
}
diff --git a/misc/lsattr.c b/misc/lsattr.c
index afc882c8..4011d628 100644
--- a/misc/lsattr.c
+++ b/misc/lsattr.c
@@ -41,6 +41,7 @@ extern char *optarg;
#include "e2p/e2p.h"
#include "../version.h"
+#include "nls-enable.h"
const char * program_name = "lsattr";
@@ -53,7 +54,7 @@ int v_opt = 0;
static void usage(void)
{
- fprintf(stderr, "Usage: %s [-RVadlv] [files...]\n", program_name);
+ fprintf(stderr, _("Usage: %s [-RVadlv] [files...]\n"), program_name);
exit(1);
}
@@ -63,10 +64,10 @@ static void list_attributes (const char * name)
unsigned long version;
if (fgetflags (name, &flags) == -1)
- com_err (program_name, errno, "While reading flags on %s",
+ com_err (program_name, errno, _("While reading flags on %s"),
name);
else if (fgetversion (name, &version) == -1)
- com_err (program_name, errno, "While reading version on %s",
+ com_err (program_name, errno, _("While reading version on %s"),
name);
else
{
@@ -84,7 +85,7 @@ static void lsattr_args (const char * name)
struct stat st;
if (lstat (name, &st) == -1)
- com_err (program_name, errno, "while stating %s", name);
+ com_err (program_name, errno, _("while stating %s"), name);
else
{
if (S_ISDIR(st.st_mode) && !d_opt)
@@ -126,6 +127,11 @@ int main (int argc, char ** argv)
int c;
int i;
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
if (argc && *argv)
program_name = *argv;
while ((c = getopt (argc, argv, "RVadlv")) != EOF)
@@ -154,7 +160,7 @@ int main (int argc, char ** argv)
}
if (verbose)
- fprintf (stderr, "lsattr %s, %s for EXT2 FS %s, %s\n",
+ fprintf (stderr, _("lsattr %s, %s for EXT2 FS %s, %s\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE,
EXT2FS_VERSION, EXT2FS_DATE);
if (optind > argc - 1)
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index ef627228..4464da59 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -52,6 +52,7 @@
#include "e2p/e2p.h"
#include "ext2fs/ext2fs.h"
#include "../version.h"
+#include "nls-enable.h"
/* Everything is STDC, these days */
#define NOARGS void
@@ -87,13 +88,13 @@ static void usage(NOARGS), check_plausibility(NOARGS), check_mount(NOARGS);
static void usage(NOARGS)
{
- fprintf(stderr, "Usage: %s [-c|-t|-l filename] [-b block-size] "
+ fprintf(stderr, _("Usage: %s [-c|-t|-l filename] [-b block-size] "
"[-f fragment-size]\n\t[-i bytes-per-inode] "
" [-N number-of-inodes]\n\t[-m reserved-blocks-percentage] "
"[-o creator-os] [-g blocks-per-group]\n\t[-L volume-label] "
"[-M last-mounted-directory] [-O feature[,...]]\n\t"
"[-r fs-revision] [-R raid_opts] [-s sparse-super-flag]\n\t"
- "[-qvSV] device [blocks-count]\n",
+ "[-qvSV] device [blocks-count]\n"),
program_name);
exit(1);
}
@@ -121,10 +122,14 @@ static int int_log10(unsigned int arg)
static void proceed_question(NOARGS)
{
+ int c;
+ char *short_yes = _("yY");
+
fflush(stdout);
fflush(stderr);
- printf("Proceed anyway? (y,n) ");
- if (getchar() != 'y')
+ printf(_("Proceed anyway? (y,n) "));
+ c = getchar();
+ if (strchr(short_yes, (char) c))
exit(1);
}
@@ -146,22 +151,22 @@ static void check_plausibility(NOARGS)
val = stat(device_name, &s);
if(val == -1) {
- fprintf(stderr, "Could not stat %s --- %s\n",
+ fprintf(stderr, _("Could not stat %s --- %s\n"),
device_name, error_message(errno));
if (errno == ENOENT)
- fprintf(stderr, "\nThe device apparently does "
- "not exist; did you specify it correctly?\n");
+ fprintf(stderr, _("\nThe device apparently does "
+ "not exist; did you specify it correctly?\n"));
exit(1);
}
if(!S_ISBLK(s.st_mode)) {
- printf("%s is not a block special device.\n", device_name);
+ printf(_("%s is not a block special device.\n"), device_name);
proceed_question();
return;
} else if ((MAJOR(s.st_rdev) == HD_MAJOR &&
MINOR(s.st_rdev)%64 == 0) ||
(SCSI_BLK_MAJOR(MAJOR(s.st_rdev)) &&
MINOR(s.st_rdev)%16 == 0)) {
- printf("%s is entire device, not just one partition!\n",
+ printf(_("%s is entire device, not just one partition!\n"),
device_name);
proceed_question();
}
@@ -176,19 +181,19 @@ static void check_mount(NOARGS)
retval = ext2fs_check_if_mounted(device_name, &mount_flags);
if (retval) {
com_err("ext2fs_check_if_mount", retval,
- "while determining whether %s is mounted.",
+ _("while determining whether %s is mounted."),
device_name);
return;
}
if (!(mount_flags & EXT2_MF_MOUNTED))
return;
- fprintf(stderr, "%s is mounted; ", device_name);
+ fprintf(stderr, _("%s is mounted; "), device_name);
if (force) {
- fprintf(stderr, "mke2fs forced anyway. "
- "Hope /etc/mtab is incorrect.\n");
+ fprintf(stderr, _("mke2fs forced anyway. "
+ "Hope /etc/mtab is incorrect.\n"));
} else {
- fprintf(stderr, "will not make a filesystem here!\n");
+ fprintf(stderr, _("will not make a filesystem here!\n"));
exit(1);
}
}
@@ -251,7 +256,7 @@ static void set_fs_defaults(char *fs_type, struct ext2fs_sb *super,
*/
static void invalid_block(ext2_filsys fs, blk_t blk)
{
- printf("Bad block %u out of range; ignored.\n", blk);
+ printf(_("Bad block %u out of range; ignored.\n"), blk);
return;
}
@@ -267,14 +272,14 @@ static void read_bb_file(ext2_filsys fs, badblocks_list *bb_list,
f = fopen(bad_blocks_file, "r");
if (!f) {
com_err("read_bad_blocks_file", errno,
- "while trying to open %s", bad_blocks_file);
+ _("while trying to open %s"), bad_blocks_file);
exit(1);
}
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
fclose (f);
if (retval) {
com_err("ext2fs_read_bb_FILE", retval,
- "while reading in list of bad blocks from file");
+ _("while reading in list of bad blocks from file"));
exit(1);
}
}
@@ -292,18 +297,18 @@ static void test_disk(ext2_filsys fs, badblocks_list *bb_list)
quiet ? "" : "-s ", fs->device_name,
fs->super->s_blocks_count);
if (verbose)
- printf("Running command: %s\n", buf);
+ printf(_("Running command: %s\n"), buf);
f = popen(buf, "r");
if (!f) {
com_err("popen", errno,
- "while trying run '%s'", buf);
+ _("while trying run '%s'"), buf);
exit(1);
}
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
pclose(f);
if (retval) {
com_err("ext2fs_read_bb_FILE", retval,
- "while processing list of bad blocks from program");
+ _("while processing list of bad blocks from program"));
exit(1);
}
}
@@ -329,12 +334,12 @@ static void handle_bad_blocks(ext2_filsys fs, badblocks_list bb_list)
must_be_good = fs->super->s_first_data_block + 1 + fs->desc_blocks;
for (i = fs->super->s_first_data_block; i <= must_be_good; i++) {
if (badblocks_list_test(bb_list, i)) {
- fprintf(stderr, "Block %d in primary superblock/group "
- "descriptor area bad.\n", i);
- fprintf(stderr, "Blocks %d through %d must be good "
- "in order to build a filesystem.\n",
+ fprintf(stderr, _("Block %d in primary "
+ "superblock/group descriptor area bad.\n"), i);
+ fprintf(stderr, _("Blocks %d through %d must be good "
+ "in order to build a filesystem.\n"),
fs->super->s_first_data_block, must_be_good);
- fprintf(stderr, "Aborting....\n");
+ fprintf(stderr, _("Aborting....\n"));
exit(1);
}
}
@@ -354,8 +359,8 @@ static void handle_bad_blocks(ext2_filsys fs, badblocks_list bb_list)
j)) {
if (!group_bad)
fprintf(stderr,
-"Warning: the backup superblock/group descriptors at block %d contain\n"
-" bad blocks.\n\n",
+_("Warning: the backup superblock/group descriptors at block %d contain\n"
+" bad blocks.\n\n"),
group_block);
group_bad++;
group = ext2fs_group_of_blk(fs, group_block+j);
@@ -372,7 +377,7 @@ static void handle_bad_blocks(ext2_filsys fs, badblocks_list bb_list)
retval = badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("badblocks_list_iterate_begin", retval,
- "while marking bad blocks as used");
+ _("while marking bad blocks as used"));
exit(1);
}
while (badblocks_list_iterate(bb_iter, &blk))
@@ -396,7 +401,8 @@ static void write_inode_tables(ext2_filsys fs)
buf = malloc(fs->blocksize * STRIDE_LENGTH);
if (!buf) {
- com_err("malloc", ENOMEM, "while allocating zeroizing buffer");
+ com_err("malloc", ENOMEM,
+ _("while allocating zeroizing buffer"));
exit(1);
}
memset(buf, 0, fs->blocksize * STRIDE_LENGTH);
@@ -412,7 +418,7 @@ static void write_inode_tables(ext2_filsys fs)
backup[(2*i)+1] = 0;
if (!quiet)
- printf("Writing inode tables: ");
+ printf(_("Writing inode tables: "));
for (i = 0; i < fs->group_desc_count; i++) {
if (!quiet)
printf(format, i, fs->group_desc_count);
@@ -427,8 +433,8 @@ static void write_inode_tables(ext2_filsys fs)
count = num - j;
retval = io_channel_write_blk(fs->io, blk, count, buf);
if (retval)
- printf("Warning: could not write %d blocks "
- "in inode table starting at %d: %s\n",
+ printf(_("Warning: could not write %d blocks "
+ "in inode table starting at %d: %s\n"),
count, blk, error_message(retval));
}
if (!quiet)
@@ -442,7 +448,7 @@ static void write_inode_tables(ext2_filsys fs)
}
free(buf);
if (!quiet)
- fputs("done \n", stdout);
+ fputs(_("done \n"), stdout);
}
static void create_root_dir(ext2_filsys fs)
@@ -452,14 +458,14 @@ static void create_root_dir(ext2_filsys fs)
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, 0);
if (retval) {
- com_err("ext2fs_mkdir", retval, "while creating root dir");
+ com_err("ext2fs_mkdir", retval, _("while creating root dir"));
exit(1);
}
if (geteuid()) {
retval = ext2fs_read_inode(fs, EXT2_ROOT_INO, &inode);
if (retval) {
com_err("ext2fs_read_inode", retval,
- "while reading root inode");
+ _("while reading root inode"));
exit(1);
}
inode.i_uid = getuid();
@@ -468,7 +474,7 @@ static void create_root_dir(ext2_filsys fs)
retval = ext2fs_write_inode(fs, EXT2_ROOT_INO, &inode);
if (retval) {
com_err("ext2fs_write_inode", retval,
- "while setting root inode ownership");
+ _("while setting root inode ownership"));
exit(1);
}
}
@@ -484,13 +490,15 @@ static void create_lost_and_found(ext2_filsys fs)
retval = ext2fs_mkdir(fs, EXT2_ROOT_INO, 0, name);
if (retval) {
- com_err("ext2fs_mkdir", retval, "while creating /lost+found");
+ com_err("ext2fs_mkdir", retval,
+ _("while creating /lost+found"));
exit(1);
}
retval = ext2fs_lookup(fs, EXT2_ROOT_INO, name, strlen(name), 0, &ino);
if (retval) {
- com_err("ext2_lookup", retval, "while looking up /lost+found");
+ com_err("ext2_lookup", retval,
+ _("while looking up /lost+found"));
exit(1);
}
@@ -500,7 +508,7 @@ static void create_lost_and_found(ext2_filsys fs)
retval = ext2fs_expand_dir(fs, ino);
if (retval) {
com_err("ext2fs_expand_dir", retval,
- "while expanding /lost+found");
+ _("while expanding /lost+found"));
exit(1);
}
}
@@ -516,7 +524,7 @@ static void create_bad_block_inode(ext2_filsys fs, badblocks_list bb_list)
retval = ext2fs_update_bb_inode(fs, bb_list);
if (retval) {
com_err("ext2fs_update_bb_inode", retval,
- "while setting bad block inode");
+ _("while setting bad block inode"));
exit(1);
}
@@ -546,7 +554,7 @@ static void zap_bootblock(ext2_filsys fs)
retval = io_channel_write_blk(fs->io, 0, -512, buf);
if (retval)
- printf("Warning: could not erase block 0: %s\n",
+ printf(_("Warning: could not erase block 0: %s\n"),
error_message(retval));
}
#endif
@@ -560,42 +568,44 @@ static void show_stats(ext2_filsys fs)
int i, need, col_left;
if (param.s_blocks_count != s->s_blocks_count)
- printf("warning: %d blocks unused.\n\n",
+ printf(_("warning: %d blocks unused.\n\n"),
param.s_blocks_count - s->s_blocks_count);
memset(buf, 0, sizeof(buf));
strncpy(buf, s->s_volume_name, sizeof(s->s_volume_name));
- printf("Filesystem label=%s\n", buf);
- printf("OS type: ");
+ printf(_("Filesystem label=%s\n"), buf);
+ printf(_("OS type: "));
switch (fs->super->s_creator_os) {
case EXT2_OS_LINUX: printf ("Linux"); break;
case EXT2_OS_HURD: printf ("GNU/Hurd"); break;
case EXT2_OS_MASIX: printf ("Masix"); break;
- default: printf ("(unknown os)");
+ default: printf (_("(unknown os)"));
}
printf("\n");
- printf("Block size=%u (log=%u)\n", fs->blocksize,
+ printf(_("Block size=%u (log=%u)\n"), fs->blocksize,
s->s_log_block_size);
- printf("Fragment size=%u (log=%u)\n", fs->fragsize,
+ printf(_("Fragment size=%u (log=%u)\n"), fs->fragsize,
s->s_log_frag_size);
- printf("%u inodes, %u blocks\n", s->s_inodes_count,
+ printf(_("%u inodes, %u blocks\n"), s->s_inodes_count,
s->s_blocks_count);
- printf("%u blocks (%2.2f%%) reserved for the super user\n",
+ printf(_("%u blocks (%2.2f%%) reserved for the super user\n"),
s->s_r_blocks_count,
100.0 * s->s_r_blocks_count / s->s_blocks_count);
- printf("First data block=%u\n", s->s_first_data_block);
- printf("%lu block group%s\n", fs->group_desc_count,
- (fs->group_desc_count > 1) ? "s" : "");
- printf("%u blocks per group, %u fragments per group\n",
+ printf(_("First data block=%u\n"), s->s_first_data_block);
+ if (fs->group_desc_count > 1)
+ printf(_("%lu block groups\n"), fs->group_desc_count);
+ else
+ printf(_("%lu block group\n"), fs->group_desc_count);
+ printf(_("%u blocks per group, %u fragments per group\n"),
s->s_blocks_per_group, s->s_frags_per_group);
- printf("%u inodes per group\n", s->s_inodes_per_group);
+ printf(_("%u inodes per group\n"), s->s_inodes_per_group);
if (fs->group_desc_count == 1) {
printf("\n");
return;
}
- printf("Superblock backups stored on blocks: ");
+ printf(_("Superblock backups stored on blocks: "));
group_block = s->s_first_data_block;
col_left = 0;
for (i = 1; i < fs->group_desc_count; i++) {
@@ -661,8 +671,8 @@ static void parse_raid_opts(const char *opts)
len = strlen(opts);
buf = malloc(len+1);
if (!buf) {
- fprintf(stderr, "Couldn't allocate memory to parse "
- "raid options!\n");
+ fprintf(stderr, _("Couldn't allocate memory to parse "
+ "raid options!\n"));
exit(1);
}
strcpy(buf, opts);
@@ -685,7 +695,8 @@ static void parse_raid_opts(const char *opts)
}
fs_stride = strtoul(arg, &p, 0);
if (*p || (fs_stride == 0)) {
- fprintf(stderr, "Invalid stride parameter.\n");
+ fprintf(stderr,
+ _("Invalid stride parameter.\n"));
raid_usage++;
continue;
}
@@ -693,12 +704,12 @@ static void parse_raid_opts(const char *opts)
raid_usage++;
}
if (raid_usage) {
- fprintf(stderr, "\nBad raid options specified.\n\n"
+ fprintf(stderr, _("\nBad raid options specified.\n\n"
"Raid 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"
- "\tstride=<stride length in blocks>\n\n");
+ "\tstride=<stride length in blocks>\n\n"));
exit(1);
}
}
@@ -758,7 +769,7 @@ static void PRS(int argc, char *argv[])
memset(&param, 0, sizeof(struct ext2_super_block));
param.s_rev_level = 1; /* Create revision 1 filesystems now */
- fprintf (stderr, "mke2fs %s, %s for EXT2 FS %s, %s\n",
+ fprintf (stderr, _("mke2fs %s, %s for EXT2 FS %s, %s\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE,
EXT2FS_VERSION, EXT2FS_DATE);
if (argc && *argv)
@@ -769,8 +780,8 @@ static void PRS(int argc, char *argv[])
case 'b':
blocksize = strtoul(optarg, &tmp, 0);
if (blocksize < 1024 || blocksize > 4096 || *tmp) {
- com_err(program_name, 0, "bad block size - %s",
- optarg);
+ com_err(program_name, 0,
+ _("bad block size - %s"), optarg);
exit(1);
}
param.s_log_block_size =
@@ -784,25 +795,26 @@ static void PRS(int argc, char *argv[])
case 'f':
size = strtoul(optarg, &tmp, 0);
if (size < 1024 || size > 4096 || *tmp) {
- com_err(program_name, 0, "bad fragment size - %s",
+ com_err(program_name, 0,
+ _("bad fragment size - %s"),
optarg);
exit(1);
}
param.s_log_frag_size =
int_log2(size >> EXT2_MIN_BLOCK_LOG_SIZE);
- printf("Warning: fragments not supported. "
- "Ignoring -f option\n");
+ printf(_("Warning: fragments not supported. "
+ "Ignoring -f option\n"));
break;
case 'g':
param.s_blocks_per_group = strtoul(optarg, &tmp, 0);
if (*tmp) {
com_err(program_name, 0,
- "Illegal number for blocks per group");
+ _("Illegal number for blocks per group"));
exit(1);
}
if ((param.s_blocks_per_group % 8) != 0) {
com_err(program_name, 0,
- "blocks per group must be multiple of 8");
+ _("blocks per group must be multiple of 8"));
exit(1);
}
break;
@@ -810,8 +822,8 @@ static void PRS(int argc, char *argv[])
inode_ratio = strtoul(optarg, &tmp, 0);
if (inode_ratio < 1024 || inode_ratio > 256 * 1024 ||
*tmp) {
- com_err(program_name, 0, "bad inode ratio - %s",
- optarg);
+ com_err(program_name, 0,
+ _("bad inode ratio - %s"), optarg);
exit(1);
}
break;
@@ -819,7 +831,7 @@ static void PRS(int argc, char *argv[])
bad_blocks_filename = malloc(strlen(optarg)+1);
if (!bad_blocks_filename) {
com_err(program_name, ENOMEM,
- "in malloc for bad_blocks_filename");
+ _("in malloc for bad_blocks_filename"));
exit(1);
}
strcpy(bad_blocks_filename, optarg);
@@ -828,7 +840,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",
+ _("bad reserved blocks percent - %s"),
optarg);
exit(1);
}
@@ -882,7 +894,7 @@ static void PRS(int argc, char *argv[])
break;
case 'V':
/* Print version number and exit */
- fprintf(stderr, "\tUsing %s\n",
+ fprintf(stderr, _("\tUsing %s\n"),
error_message(EXT2_ET_BASE));
exit(0);
default:
@@ -895,7 +907,7 @@ static void PRS(int argc, char *argv[])
if (optind < argc) {
param.s_blocks_count = strtoul(argv[optind++], &tmp, 0);
if (*tmp) {
- com_err(program_name, 0, "bad blocks count - %s",
+ com_err(program_name, 0, _("bad blocks count - %s"),
argv[optind - 1]);
exit(1);
}
@@ -921,21 +933,21 @@ static void PRS(int argc, char *argv[])
&dev_size);
if (retval && (retval != EXT2_ET_UNIMPLEMENTED)) {
com_err(program_name, retval,
- "while trying to determine filesystem size");
+ _("while trying to determine filesystem size"));
exit(1);
}
if (!param.s_blocks_count) {
if (retval == EXT2_ET_UNIMPLEMENTED) {
com_err(program_name, 0,
- "Couldn't determine device size; you "
+ _("Couldn't determine device size; you "
"must specify\nthe size of the "
- "filesystem\n");
+ "filesystem\n"));
exit(1);
} else
param.s_blocks_count = dev_size;
} else if (!force && (param.s_blocks_count > dev_size)) {
com_err(program_name, 0,
- "Filesystem larger than apparent filesystem size.");
+ _("Filesystem larger than apparent filesystem size."));
proceed_question();
}
@@ -945,7 +957,7 @@ static void PRS(int argc, char *argv[])
if (param.s_blocks_per_group < 256 ||
param.s_blocks_per_group > max || *tmp) {
com_err(program_name, 0,
- "blocks per group count out of range");
+ _("blocks per group count out of range"));
exit(1);
}
}
@@ -972,7 +984,7 @@ static void PRS(int argc, char *argv[])
if (feature_set && e2p_edit_feature(feature_set,
&param_ext2->s_feature_compat,
ok_features)) {
- fprintf(stderr, "Invalid filesystem option set: %s\n",
+ fprintf(stderr, _("Invalid filesystem option set: %s\n"),
feature_set);
exit(1);
}
@@ -984,7 +996,12 @@ int main (int argc, char *argv[])
ext2_filsys fs;
badblocks_list bb_list = 0;
struct ext2fs_sb *s;
-
+
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
PRS(argc, argv);
/*
@@ -993,7 +1010,7 @@ int main (int argc, char *argv[])
retval = ext2fs_initialize(device_name, 0, &param,
unix_io_manager, &fs);
if (retval) {
- com_err(device_name, retval, "while setting up superblock");
+ com_err(device_name, retval, _("while setting up superblock"));
exit(1);
}
@@ -1007,7 +1024,7 @@ int main (int argc, char *argv[])
* Override the creator OS, if applicable
*/
if (creator_os && !set_os(fs->super, creator_os)) {
- com_err (program_name, 0, "unknown os - %s", creator_os);
+ com_err (program_name, 0, _("unknown os - %s"), creator_os);
exit(1);
}
@@ -1045,7 +1062,7 @@ int main (int argc, char *argv[])
retval = ext2fs_allocate_tables(fs);
if (retval) {
com_err(program_name, retval,
- "while trying to allocate filesystem tables");
+ _("while trying to allocate filesystem tables"));
exit(1);
}
if (super_only) {
@@ -1063,14 +1080,14 @@ int main (int argc, char *argv[])
}
if (!quiet)
- printf("Writing superblocks and "
- "filesystem accounting information: ");
+ printf(_("Writing superblocks and "
+ "filesystem accounting information: "));
retval = ext2fs_flush(fs);
if (retval) {
- printf("\nWarning, had trouble writing out superblocks.");
+ printf(_("\nWarning, had trouble writing out superblocks."));
}
if (!quiet)
- printf("done\n");
+ printf(_("done\n"));
ext2fs_close(fs);
return 0;
}
diff --git a/misc/mklost+found.c b/misc/mklost+found.c
index 772e21ee..a4d0f7d9 100644
--- a/misc/mklost+found.c
+++ b/misc/mklost+found.c
@@ -24,6 +24,7 @@
#include <linux/ext2_fs.h>
#include "../version.h"
+#include "nls-enable.h"
#define LPF "lost+found"
@@ -35,11 +36,16 @@ int main (int argc, char ** argv)
int i, j;
int d;
- fprintf (stderr, "mklost+found %s, %s for EXT2 FS %s, %s\n",
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
+ fprintf (stderr, _("mklost+found %s, %s for EXT2 FS %s, %s\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE,
EXT2FS_VERSION, EXT2FS_DATE);
if (argc != 1) {
- fprintf (stderr, "Usage: mklost+found\n");
+ fprintf (stderr, _("Usage: mklost+found\n"));
exit(1);
}
if (mkdir (LPF, 0755) == -1) {
diff --git a/misc/nls-enable.h b/misc/nls-enable.h
new file mode 100644
index 00000000..f9d2c856
--- /dev/null
+++ b/misc/nls-enable.h
@@ -0,0 +1,17 @@
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define _(a) (gettext (a))
+#ifdef gettext_noop
+#define N_(a) gettext_noop (a)
+#else
+#define N_(a) (a)
+#endif
+/* FIXME */
+#define NLS_CAT_NAME "e2fsprogs"
+#define LOCALEDIR "/usr/share/locale"
+/* FIXME */
+#else
+#define _(a) (a)
+#define N_(a) a
+#endif
diff --git a/misc/partinfo.c b/misc/partinfo.c
index 588a631a..cdb7591a 100644
--- a/misc/partinfo.c
+++ b/misc/partinfo.c
@@ -14,10 +14,11 @@
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
+#include "nls-enable.h"
void print_error(char *operation, int error, char *device)
{
- fprintf(stderr, "%s failed for %s: %s\n", operation, device,
+ fprintf(stderr, _("%s failed for %s: %s\n"), operation, device,
strerror(error));
}
@@ -27,12 +28,17 @@ int main(int argc, char **argv)
int fd, i;
long size;
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
if (argc == 1) {
- fprintf(stderr, "Usage: %s <dev1> <dev2> <dev3>\n\n"
+ 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 progrma is:\n\n\t"
- "%s /dev/hda?\n\n", argv[0], argv[0]);
+ "A common way to use this program is:\n\n\t"
+ "%s /dev/hda?\n\n"), argv[0], argv[0]);
exit(1);
}
@@ -45,14 +51,14 @@ int main(int argc, char **argv)
}
if (ioctl(fd, HDIO_GETGEO, &loc) < 0) {
- print_error("HDIO_GETGEO ioctl", errno, argv[i]);
+ print_error(_("HDIO_GETGEO ioctl"), errno, argv[i]);
close(fd);
continue;
}
if (ioctl(fd, BLKGETSIZE, &size) < 0) {
- print_error("BLKGETSIZE ioctl", errno, argv[i]);
+ print_error(_("BLKGETSIZE ioctl"), errno, argv[i]);
close(fd);
continue;
}
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index fba60c1e..3f120a3c 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -47,6 +47,7 @@
#include "e2p/e2p.h"
#include "../version.h"
+#include "nls-enable.h"
const char * program_name = "tune2fs";
char * device_name = NULL;
@@ -92,13 +93,13 @@ static int strcasecmp (char *s1, char *s2)
static void usage(void)
{
- fprintf(stderr, "Usage: %s [-c max-mounts-count] [-e errors-behavior] "
+ fprintf(stderr, _("Usage: %s [-c max-mounts-count] [-e errors-behavior] "
"[-g group]\n"
"\t[-i interval[d|m|w]] [-l] [-s sparse-flag] "
"[-m reserved-blocks-percent]\n"
"\t[-r reserved-blocks-count] [-u user] [-C mount-count]\n"
"\t[-L volume-label] [-M last-mounted-dir] [-U UUID]\n"
- "\t[-O [^]feature[,...]] device\n", program_name);
+ "\t[-O [^]feature[,...]] device\n"), program_name);
exit (1);
}
@@ -108,7 +109,7 @@ static __u32 ok_features[3] = {
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER /* R/O compat */
};
-static const char *please_fsck = "Please run e2fsck on the filesystem.\n";
+static const char *please_fsck = _("Please run e2fsck on the filesystem.\n");
int main (int argc, char ** argv)
{
@@ -122,7 +123,12 @@ int main (int argc, char ** argv)
int open_flag = 0;
char *features_cmd = 0;
- fprintf (stderr, "tune2fs %s, %s for EXT2 FS %s, %s\n",
+#ifdef ENABLE_NLS
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
+ textdomain(NLS_CAT_NAME);
+#endif
+ fprintf (stderr, _("tune2fs %s, %s for EXT2 FS %s, %s\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE,
EXT2FS_VERSION, EXT2FS_DATE);
if (argc && *argv)
@@ -135,7 +141,7 @@ int main (int argc, char ** argv)
max_mount_count = strtoul (optarg, &tmp, 0);
if (*tmp || max_mount_count > 16000) {
com_err (program_name, 0,
- "bad mounts count - %s",
+ _("bad mounts count - %s"),
optarg);
usage();
}
@@ -146,7 +152,7 @@ int main (int argc, char ** argv)
mount_count = strtoul (optarg, &tmp, 0);
if (*tmp || mount_count > 16000) {
com_err (program_name, 0,
- "bad mounts count - %s",
+ _("bad mounts count - %s"),
optarg);
usage();
}
@@ -162,7 +168,7 @@ int main (int argc, char ** argv)
errors = EXT2_ERRORS_PANIC;
else {
com_err (program_name, 0,
- "bad error behavior - %s",
+ _("bad error behavior - %s"),
optarg);
usage();
}
@@ -182,7 +188,7 @@ int main (int argc, char ** argv)
}
if (*tmp) {
com_err (program_name, 0,
- "bad gid/group name - %s",
+ _("bad gid/group name - %s"),
optarg);
usage();
}
@@ -215,7 +221,7 @@ int main (int argc, char ** argv)
}
if (*tmp || interval > (365 * 86400)) {
com_err (program_name, 0,
- "bad interval - %s", optarg);
+ _("bad interval - %s"), optarg);
usage();
}
i_flag = 1;
@@ -233,7 +239,7 @@ int main (int argc, char ** argv)
reserved_ratio = strtoul (optarg, &tmp, 0);
if (*tmp || reserved_ratio > 50) {
com_err (program_name, 0,
- "bad reserved block ratio - %s",
+ _("bad reserved block ratio - %s"),
optarg);
usage();
}
@@ -253,7 +259,7 @@ int main (int argc, char ** argv)
reserved_blocks = strtoul (optarg, &tmp, 0);
if (*tmp) {
com_err (program_name, 0,
- "bad reserved blocks count - %s",
+ _("bad reserved blocks count - %s"),
optarg);
usage();
}
@@ -277,7 +283,7 @@ int main (int argc, char ** argv)
}
if (*tmp) {
com_err (program_name, 0,
- "bad uid/user name - %s",
+ _("bad uid/user name - %s"),
optarg);
usage();
}
@@ -300,9 +306,9 @@ int main (int argc, char ** argv)
retval = ext2fs_open (device_name, open_flag, 0, 0,
unix_io_manager, &fs);
if (retval) {
- com_err (program_name, retval, "while trying to open %s",
+ com_err (program_name, retval, _("while trying to open %s"),
device_name);
- printf("Couldn't find valid filesystem superblock.\n");
+ printf(_("Couldn't find valid filesystem superblock.\n"));
exit(1);
}
sb = (struct ext2fs_sb *) fs->super;
@@ -310,94 +316,94 @@ int main (int argc, char ** argv)
if (c_flag) {
fs->super->s_max_mnt_count = max_mount_count;
ext2fs_mark_super_dirty(fs);
- printf ("Setting maximal mount count to %d\n",
+ printf (_("Setting maximal mount count to %d\n"),
max_mount_count);
}
if (C_flag) {
fs->super->s_mnt_count = mount_count;
ext2fs_mark_super_dirty(fs);
- printf ("Setting current mount count to %d\n", mount_count);
+ printf (_("Setting current mount count to %d\n"), mount_count);
}
if (e_flag) {
fs->super->s_errors = errors;
ext2fs_mark_super_dirty(fs);
- printf ("Setting error behavior to %d\n", errors);
+ printf (_("Setting error behavior to %d\n"), errors);
}
if (g_flag)
#ifdef EXT2_DEF_RESGID
{
fs->super->s_def_resgid = resgid;
ext2fs_mark_super_dirty(fs);
- printf ("Setting reserved blocks gid to %lu\n", resgid);
+ printf (_("Setting reserved blocks gid to %lu\n"), resgid);
}
#else
com_err (program_name, 0,
- "The -g option is not supported by this version -- "
- "Recompile with a newer kernel");
+ _("The -g option is not supported by this version -- "
+ "Recompile with a newer kernel"));
#endif
if (i_flag) {
fs->super->s_checkinterval = interval;
ext2fs_mark_super_dirty(fs);
- printf ("Setting interval between check %lu seconds\n", interval);
+ printf (_("Setting interval between check %lu seconds\n"), interval);
}
if (m_flag) {
fs->super->s_r_blocks_count = (fs->super->s_blocks_count / 100)
* reserved_ratio;
ext2fs_mark_super_dirty(fs);
- printf ("Setting reserved blocks percentage to %lu (%u blocks)\n",
+ printf (_("Setting reserved blocks percentage to %lu (%u blocks)\n"),
reserved_ratio, fs->super->s_r_blocks_count);
}
if (r_flag) {
if (reserved_blocks >= fs->super->s_blocks_count) {
com_err (program_name, 0,
- "reserved blocks count is too big (%ul)",
+ _("reserved blocks count is too big (%ul)"),
reserved_blocks);
exit (1);
}
fs->super->s_r_blocks_count = reserved_blocks;
ext2fs_mark_super_dirty(fs);
- printf ("Setting reserved blocks count to %lu\n",
+ printf (_("Setting reserved blocks count to %lu\n"),
reserved_blocks);
}
if (s_flag == 1) {
#ifdef EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
if (sb->s_feature_ro_compat &
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)
- fprintf(stderr, "\nThe filesystem already"
- " has spare superblocks.\n");
+ fprintf(stderr, _("\nThe filesystem already"
+ " has spare superblocks.\n"));
else {
sb->s_feature_ro_compat |=
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
fs->super->s_state &= ~EXT2_VALID_FS;
ext2fs_mark_super_dirty(fs);
- printf("\nSparse superblock flag set. %s",
+ printf(_("\nSparse superblock flag set. %s"),
please_fsck);
}
#else /* !EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER */
com_err (program_name, 0,
- "The -s option is not supported by this version -- "
- "Recompile with a newer kernel");
+ _("The -s option is not supported by this version -- "
+ "Recompile with a newer kernel"));
#endif /* EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER */
}
if (s_flag == 0) {
#ifdef EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER
if (!(sb->s_feature_ro_compat &
EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER))
- fprintf(stderr, "\nThe filesystem already"
- " does not support spare superblocks.\n");
+ fprintf(stderr, _("\nThe filesystem already"
+ " does not support spare superblocks.\n"));
else {
sb->s_feature_ro_compat &=
~EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER;
fs->super->s_state &= ~EXT2_VALID_FS;
fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
ext2fs_mark_super_dirty(fs);
- printf("\nSparse superblock flag cleared. %s",
+ printf(_("\nSparse superblock flag cleared. %s"),
please_fsck);
}
#else /* !EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER */
com_err (program_name, 0,
- "The -s option is not supported by this version -- "
- "Recompile with a newer kernel");
+ _("The -s option is not supported by this version -- "
+ "Recompile with a newer kernel"));
#endif /* EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER */
}
@@ -406,17 +412,17 @@ int main (int argc, char ** argv)
{
fs->super->s_def_resuid = resuid;
ext2fs_mark_super_dirty(fs);
- printf ("Setting reserved blocks uid to %lu\n", resuid);
+ printf (_("Setting reserved blocks uid to %lu\n"), resuid);
}
#else
com_err (program_name, 0,
- "The -u option is not supported by this version -- "
- "Recompile with a newer kernel");
+ _("The -u option is not supported by this version -- "
+ "Recompile with a newer kernel"));
#endif
if (L_flag) {
if (strlen(new_label) > sizeof(sb->s_volume_name))
- fprintf(stderr, "Warning: label too "
- "long, truncating.\n");
+ fprintf(stderr, _("Warning: label too "
+ "long, truncating.\n"));
memset(sb->s_volume_name, 0, sizeof(sb->s_volume_name));
strncpy(sb->s_volume_name, new_label,
sizeof(sb->s_volume_name));
@@ -438,7 +444,7 @@ int main (int argc, char ** argv)
if (e2p_edit_feature(features_cmd,
&sb->s_feature_compat,
ok_features)) {
- fprintf(stderr, "Invalid filesystem option set: %s\n",
+ fprintf(stderr, _("Invalid filesystem option set: %s\n"),
features_cmd);
exit(1);
}
@@ -459,7 +465,7 @@ int main (int argc, char ** argv)
} else if (strcasecmp(new_UUID, "random") == 0) {
uuid_generate(sb->s_uuid);
} else if (uuid_parse(new_UUID, sb->s_uuid)) {
- com_err(program_name, 0, "Invalid UUID format\n");
+ com_err(program_name, 0, _("Invalid UUID format\n"));
exit(1);
}
ext2fs_mark_super_dirty(fs);
diff --git a/misc/uuidgen.c b/misc/uuidgen.c
index da402c8a..b1d24ea1 100644
--- a/misc/uuidgen.c
+++ b/misc/uuidgen.c
@@ -14,13 +14,14 @@
#include <getopt.h>
#endif
#include "uuid/uuid.h"
+#include "nls-enable.h"
#define DO_TYPE_TIME 1
#define DO_TYPE_RANDOM 2
void usage(const char *progname)
{
- fprintf(stderr, "Usage: %s [-r] [-t]\n", progname);
+ fprintf(stderr, _("Usage: %s [-r] [-t]\n"), progname);
exit(1);
}