diff --git a/misc/ChangeLog b/misc/ChangeLog
index 2f53083..4a21277 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 f687fe7..6057115 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 @@
 
 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 @@
 	/* 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 @@
 	/* 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 @@
       && 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 @@
 
 	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 @@
 	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 @@
 	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 @@
 
 	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 @@
 					 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 @@
 			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 @@
 					 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 @@
 	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 @@
 	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 @@
 	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 @@
 						    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 @@
 		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 @@
 		   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 @@
 
 	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 @@
 			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 @@
 	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 @@
 		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 @@
 			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 @@
 		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 @@
 
 	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 @@
 				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 @@
 		)	? 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 @@
 		fclose (out);
 	return 0;
 }
+
diff --git a/misc/chattr.c b/misc/chattr.c
index de1480c..fd5210a 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 @@
 	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 @@
 				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 @@
 
 	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 @@
 	{
 		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 @@
 	{
 		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 @@
 				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 @@
 
 		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 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 @@
 		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 da02512..9056129 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 @@
 
 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 @@
 		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 @@
 	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 @@
 	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		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 @@
 			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 @@
 			      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 @@
 		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 @@
 		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 8c0df8b..477c34b 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 @@
 	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 @@
 	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 @@
 	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 3a1ef3b..4cca6cf 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 @@
 	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 @@
 	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 @@
 		       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 9b42820..1e76257 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 @@
 
 	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 @@
 			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 @@
 	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 @@
 
 	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 @@
 				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 @@
 		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 @@
 	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 @@
 	/* 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 @@
 	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 @@
 			}
 		}
 		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 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 @@
 		    (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 @@
 		}
 		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 @@
 			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 @@
 	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 cfb49f5..e03e0f1 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 @@
 	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 afc882c..4011d62 100644
--- a/misc/lsattr.c
+++ b/misc/lsattr.c
@@ -41,6 +41,7 @@
 #include "e2p/e2p.h"
 
 #include "../version.h"
+#include "nls-enable.h"
 
 const char * program_name = "lsattr";
 
@@ -53,7 +54,7 @@
 
 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 @@
 	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 @@
 	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 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 @@
 		}
 
 	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 ef62722..4464da5 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)
 {
-	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 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 @@
 	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 @@
 	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 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 @@
 	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 @@
 		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 @@
 	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 @@
 						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 @@
 	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 @@
 
 	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 @@
 		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 @@
 				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 @@
 	}
 	free(buf);
 	if (!quiet)
-		fputs("done                            \n", stdout);
+		fputs(_("done                            \n"), stdout);
 }
 
 static void create_root_dir(ext2_filsys fs)
@@ -452,14 +458,14 @@
 
 	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 @@
 		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 @@
 
 	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 @@
 		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 @@
 	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 @@
 	
 	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 @@
 	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 @@
 	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 @@
 			}
 			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 @@
 			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 @@
 	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 @@
 		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 @@
 		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 @@
 			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 @@
 			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 @@
 			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 @@
 			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 @@
 	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 @@
 						&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 @@
 		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 @@
 	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 @@
 	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 @@
 	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 @@
 	 * 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 @@
 	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 @@
 	}
 	
 	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 772e21e..a4d0f7d 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 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 0000000..f9d2c85
--- /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 588a631..cdb7591 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 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 @@
 		}
     
 		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 fba60c1..3f120a3 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 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 @@
 	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 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 @@
 				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 @@
 				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 @@
 					errors = EXT2_ERRORS_PANIC;
 				else {
 					com_err (program_name, 0,
-						 "bad error behavior - %s",
+						 _("bad error behavior - %s"),
 						 optarg);
 					usage();
 				}
@@ -182,7 +188,7 @@
 				}
 				if (*tmp) {
 					com_err (program_name, 0,
-						 "bad gid/group name - %s",
+						 _("bad gid/group name - %s"),
 						 optarg);
 					usage();
 				}
@@ -215,7 +221,7 @@
 				}
 				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 @@
 				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 @@
 				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 @@
 				}
 				if (*tmp) {
 					com_err (program_name, 0,
-						 "bad uid/user name - %s",
+						 _("bad uid/user name - %s"),
 						 optarg);
 					usage();
 				}
@@ -300,9 +306,9 @@
 	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 @@
 	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 @@
 	{
 		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 @@
 		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 @@
 		} 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 da402c8..b1d24ea 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);
 }
 
