From 8c219bf463dbbae412767d269bff1cdd4e4bf4a5 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 6 Feb 2012 16:11:27 +0100 Subject: textual: gettextize several overlooked messages Also improve the clarity of some of them. Signed-off-by: Benno Schulenberg --- disk-utils/mkswap.c | 10 +++++----- misc-utils/rename.c | 3 +-- schedutils/chrt.c | 4 ++-- schedutils/ionice.c | 4 ++-- schedutils/taskset.c | 2 +- sys-utils/hwclock.c | 2 +- term-utils/agetty.c | 26 +++++++++++++------------- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 415a9859b..4f59a63c7 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -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; diff --git a/misc-utils/rename.c b/misc-utils/rename.c index 21bd52220..71da2eba2 100644 --- a/misc-utils/rename.c +++ b/misc-utils/rename.c @@ -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); } diff --git a/schedutils/chrt.c b/schedutils/chrt.c index be10076b1..034791448 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -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; diff --git a/schedutils/ionice.c b/schedutils/ionice.c index e25428d94..f74e3c4ad 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -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); } diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 05f294c0c..903959848 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -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': diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c index 04aa650a0..5235fb855 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -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; } diff --git a/term-utils/agetty.c b/term-utils/agetty.c index ed97bc560..34b0afc2c 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -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")); } -- cgit v1.2.3-55-g7522