From: Pedro Ribeiro
Date: Fri, 3 Oct 2008 06:22:50 +0000 (+0200)
Subject: elvtune: add NLS support
X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90d43eca4ef58e74281345da3562b5fd59400137;p=util-linux
elvtune: add NLS support
[kzak@redhat.com: - add missing setlocale(), ...]
Signed-off-by: Pedro Ribeiro
Signed-off-by: Karel Zak
---
diff --git a/disk-utils/elvtune.c b/disk-utils/elvtune.c
index fc7550ba..b5bb3782 100644
--- a/disk-utils/elvtune.c
+++ b/disk-utils/elvtune.c
@@ -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;
}