]> err.no Git - util-linux/commitdiff
elvtune: add NLS support
authorPedro Ribeiro <p.m42.ribeiro@gmail.com>
Fri, 3 Oct 2008 06:22:50 +0000 (08:22 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Oct 2008 06:22:50 +0000 (08:22 +0200)
[kzak@redhat.com: - add missing setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/elvtune.c

index fc7550ba6150ce350d808b2156932d8566e12629..b5bb3782b078e1a0134926554e64d44cbe7c8188 100644 (file)
@@ -50,7 +50,7 @@ usage(void) {
                        " /dev/blkdev1 [/dev/blkdev2...]\n");
        fprintf(stderr, "\telvtune -h\n");
        fprintf(stderr, "\telvtune -v\n");
-       fprintf(stderr, "\tNOTE: elvtune only works with 2.4 kernels\n");
+       fprintf(stderr, _("\tNOTE: elvtune only works with 2.4 kernels\n"));
        /* (ioctls exist in 2.2.16 - 2.5.57) */
 }
 
@@ -69,6 +69,10 @@ main(int argc, char * argv[]) {
 
        read_set = write_set = bomb_set = set = 0;
 
+       setlocale(LC_MESSAGES, "");
+       bindtextdomain(PACKAGE, LOCALEDIR);
+       textdomain(PACKAGE);
+
        for (;;) {
                int opt;
 
@@ -97,13 +101,13 @@ main(int argc, char * argv[]) {
                case '?':
                default:
                case ':':
-                       fprintf(stderr, "parse error\n");
+                       fprintf(stderr, _("parse error\n"));
                        exit(1);
                }
        }
 
        if (optind >= argc)
-               fprintf(stderr, "missing blockdevice, use -h for help\n"), exit(1);
+               fprintf(stderr, _("missing blockdevice, use -h for help\n")), exit(1);
 
        while (optind < argc) {
                devname = argv[optind++];
@@ -124,9 +128,9 @@ main(int argc, char * argv[]) {
                        if ((errsv == EINVAL || errsv == ENOTTY) &&
                            get_linux_version() >= KERNEL_VERSION(2,5,58)) {
                                fprintf(stderr,
-                                       "\nelvtune is only useful on older "
+                                       _("\nelvtune is only useful on older "
                                        "kernels;\nfor 2.6 use IO scheduler "
-                                       "sysfs tunables instead..\n");
+                                       "sysfs tunables instead..\n"));
                        }
                        break;
                }