textual: gettextize several overlooked messages

Also improve the clarity of some of them.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
This commit is contained in:
Benno Schulenberg 2012-02-06 16:11:27 +01:00 committed by Karel Zak
parent c602fe5a8e
commit 8c219bf463
7 changed files with 25 additions and 26 deletions

View File

@ -434,7 +434,7 @@ wipe_device(int fd, const char *devname, int force)
fprintf(stderr, _(" (%s partition table detected). "), type);
else
fprintf(stderr, _(" (compiled without libblkid). "));
fprintf(stderr, "Use -f to force.\n");
fprintf(stderr, _("Use -f to force.\n"));
}
#ifdef HAVE_LIBBLKID
blkid_free_probe(pr);
@ -485,13 +485,13 @@ main(int argc, char **argv) {
force=1;
break;
case 'p':
user_pagesize = strtou32_or_err(optarg, _("parse page size failed"));
user_pagesize = strtou32_or_err(optarg, _("parsing page size failed"));
break;
case 'L':
opt_label = optarg;
break;
case 'v':
version = strtos32_or_err(optarg, _("parse version number failed"));
version = strtos32_or_err(optarg, _("parsing version number failed"));
break;
case 'U':
#ifdef HAVE_LIBUUID
@ -515,7 +515,7 @@ main(int argc, char **argv) {
if (optind < argc)
block_count = argv[optind++];
if (optind != argc) {
warnx(("only one device as argument is currently supported."));
warnx(_("only one device argument is currently supported"));
usage(stderr);
}
@ -526,7 +526,7 @@ main(int argc, char **argv) {
#ifdef HAVE_LIBUUID
if(opt_uuid) {
if (uuid_parse(opt_uuid, uuid_dat) != 0)
errx(EXIT_FAILURE, _("error: UUID parsing failed"));
errx(EXIT_FAILURE, _("error: parsing UUID failed"));
} else
uuid_generate(uuid_dat);
uuid = uuid_dat;

View File

@ -88,7 +88,6 @@ static int do_rename(char *from, char *to, char *s, int verbose, int symtarget)
printf("`%s' -> `%s'\n", s, newname);
}
free(newname);
return 1;
}
@ -148,7 +147,7 @@ int main(int argc, char **argv)
argv += optind;
if (argc < 3) {
warnx("not enough arguments");
warnx(_("not enough arguments"));
usage(stderr);
}

View File

@ -263,8 +263,8 @@ int main(int argc, char **argv)
verbose = 1;
break;
case 'V':
printf("%s from %s\n", program_invocation_short_name,
PACKAGE_STRING);
printf(_("%s from %s\n"), program_invocation_short_name,
PACKAGE_STRING);
return EXIT_SUCCESS;
case 'h':
ret = EXIT_SUCCESS;

View File

@ -82,8 +82,8 @@ static void ioprio_print(int pid)
name = to_prio[ioclass];
if (ioclass != IOPRIO_CLASS_IDLE)
printf("%s: prio %lu\n", name,
IOPRIO_PRIO_DATA(ioprio));
printf(_("%s: priority %lu\n"), name,
IOPRIO_PRIO_DATA(ioprio));
else
printf("%s\n", name);
}

View File

@ -163,7 +163,7 @@ int main(int argc, char **argv)
ts.use_list = 1;
break;
case 'V':
printf("%s from %s\n", program_invocation_short_name,
printf(_("%s from %s\n"), program_invocation_short_name,
PACKAGE_STRING);
return EXIT_SUCCESS;
case 'h':

View File

@ -262,7 +262,7 @@ static int read_adjtime(struct adjtime *adjtime_p)
adjfile = fopen(adj_file_name, "r"); /* open file for reading */
if (adjfile == NULL) {
warn("cannot open %s", adj_file_name);
warn(_("cannot open %s"), adj_file_name);
return EX_OSFILE;
}

View File

@ -353,7 +353,7 @@ int main(int argc, char **argv)
if (options.autolog) {
/* Autologin prompt */
do_prompt(&options, &termios);
printf("%s%s (automatic login)\n", LOGIN, options.autolog);
printf(_("%s%s (automatic login)\n"), LOGIN, options.autolog);
} else {
/* Read the login name. */
debug("reading login name\n");
@ -901,7 +901,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
if (((tid = tcgetsid(fd)) < 0) || (pid != tid)) {
if (ioctl(fd, TIOCSCTTY, 1) == -1)
log_warn("/dev/%s: cannot get controlling tty: %m", tty);
log_warn(_("/dev/%s: cannot get controlling tty: %m"), tty);
}
close(STDIN_FILENO);
@ -923,7 +923,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
closed = 1;
if (vhangup())
log_err("/dev/%s: vhangup() failed: %m", tty);
log_err(_("/dev/%s: vhangup() failed: %m"), tty);
} else
close(fd);
@ -933,7 +933,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
if (((tid = tcgetsid(STDIN_FILENO)) < 0) || (pid != tid)) {
if (ioctl(STDIN_FILENO, TIOCSCTTY, 1) == -1)
log_warn("/dev/%s: cannot get controlling tty: %m", tty);
log_warn(_("/dev/%s: cannot get controlling tty: %m"), tty);
}
} else {
@ -949,7 +949,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
}
if (tcsetpgrp(STDIN_FILENO, pid))
log_warn("/dev/%s: cannot set process group: %m", tty);
log_warn(_("/dev/%s: cannot set process group: %m"), tty);
/* Get rid of the present outputs. */
if (!closed) {
@ -980,7 +980,7 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
*/
memset(tp, 0, sizeof(struct termios));
if (tcgetattr(STDIN_FILENO, tp) < 0)
log_err("%s: tcgetattr: %m", tty);
log_err(_("%s: failed to get terminal attributes: %m"), tty);
/*
* Detect if this is a virtual console or serial/modem line.
@ -1138,7 +1138,7 @@ static void reset_vc(const struct options *op, struct termios *tp)
reset_virtual_console(tp, fl);
if (tcsetattr(STDIN_FILENO, TCSADRAIN, tp))
log_warn("tcsetattr problem: %m");
log_warn(_("setting terminal attributes failed: %m"));
}
/* Extract baud rate from modem status message. */
@ -1276,7 +1276,7 @@ static void do_prompt(struct options *op, struct termios *tp)
}
#endif /* ISSUE */
if (op->flags & F_LOGINPAUSE) {
puts("[press ENTER to login]");
puts(_("[press ENTER to login]"));
getc(stdin);
}
#ifdef KDGKBLED
@ -1497,7 +1497,7 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
len = mbstowcs((wchar_t *)0, logname, 0);
if (len < 0)
log_err("%s: invalid character conversion for login name", op->tty);
log_err(_("%s: invalid character conversion for login name"), op->tty);
wcs = (wchar_t *) malloc((len + 1) * sizeof(wchar_t));
if (!wcs)
@ -1505,13 +1505,13 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
len = mbstowcs(wcs, logname, len + 1);
if (len < 0)
log_err("%s: invalid character conversion for login name", op->tty);
log_err(_("%s: invalid character conversion for login name"), op->tty);
wcp = wcs;
while (*wcp) {
const wint_t wc = *wcp++;
if (!iswprint(wc))
log_err("%s: invalid character 0x%x in login name", op->tty, wc);
log_err(_("%s: invalid character 0x%x in login name"), op->tty, wc);
}
free(wcs);
} else
@ -1596,7 +1596,7 @@ static void termio_final(struct options *op, struct termios *tp, struct chardata
/* Finally, make the new settings effective. */
if (tcsetattr(STDIN_FILENO, TCSANOW, tp) < 0)
log_err("%s: tcsetattr: TCSANOW: %m", op->tty);
log_err(_("%s: failed to set terminal attributes: %m"), op->tty);
}
/*
@ -2053,6 +2053,6 @@ static void check_username(const char* nm)
return;
err:
errno = EPERM;
log_err("checkname: %m");
log_err(_("checkname failed: %m"));
}