elvtune: add NLS support

[kzak@redhat.com: - add missing setlocale(), ...]

Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Pedro Ribeiro 2008-10-03 08:22:50 +02:00 committed by Karel Zak
parent 7a451aa995
commit 90d43eca4e
1 changed files with 9 additions and 5 deletions

View 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;
}