bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Adjust two xargs diagnostics (was: Localization bugs in findutil


From: Jim Meyering
Subject: [PATCH] Adjust two xargs diagnostics (was: Localization bugs in findutils
Date: Mon, 09 Nov 2009 10:44:17 +0100

James Youngman wrote:
> On Fri, Oct 23, 2009 at 6:09 PM, Jorma Karvonen
> <address@hidden> wrote:
>> Hello,
>>
>> here are some messages that probably need to be localized. I have
>> shown them in localized form:
>
> Thanks, I'm not sure which version of findutils you started with, but
> since you gave the strings too, I had no problems finding the messages
> you were referring to.  A couple of them were obsolete, but thanks for
> finding the ones that were still in there!
>
> I have left a few of the messages un-translated as they're just debug
> messages.   I attach the patch I just pushed.
>
> Thanks again!
> James.
...
> -  const char *errmsg = "arithmetic overflow while converting %s "
> -    "days to a number of seconds";
> +  const char *errmsg = _("arithmetic overflow while converting %s "
> +                      "days to a number of seconds");
>    struct timespec origin;
>
>    if (!collect_arg(argv, arg_ptr, &timearg))

Hi James,

I spotted at least one more with this:

  $ grep -nE '\<error \([^"]*"[^"]*[a-z]{3}' $(g ls-files) | grep -v '_('
  xargs/xargs.c:1009:         error (1, errno, "/dev/tty");
  xargs/xargs.c:1093:     error (1, errno, "could not create pipe before fork");

Regarding this one,
  xargs/xargs.c:1009:         error (1, errno, "/dev/tty");
it's better for those on the receiving end of such a diagnostic
to say what operation was being attempted, so...


[btw, the above check for unmarked-yet-translatable diagnostics is automated
 in gnulib's maint.mk.  If you're interested, running "make syntax-check"
 can detect problems like this;  to enable, use gnulib's maintainer-makefile
 module. ]


>From 333b90e420200f8c083264ba1781dc01221d2807 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 9 Nov 2009 10:39:35 +0100
Subject: [PATCH] Adjust two xargs diagnostics.

* xargs/xargs.c (print_args): Give a better diagnostic when
failing to open /dev/tty.
(xargs_do_exec): Mark a diagnostic for translation.
---
 ChangeLog     |    7 +++++++
 xargs/xargs.c |    4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 126e32a..6c88e3d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-11-09  Jim Meyering  <address@hidden>
+
+       Adjust two xargs diagnostics.
+       * xargs/xargs.c (print_args): Give a better diagnostic when
+       failing to open /dev/tty.
+       (xargs_do_exec): Mark a diagnostic for translation.
+
 2009-11-08  James Youngman  <address@hidden>

        Localise some previously non-localised strings.
diff --git a/xargs/xargs.c b/xargs/xargs.c
index fb97696..4bf61d2 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1006,7 +1006,7 @@ print_args (boolean ask)
        {
          tty_stream = fopen ("/dev/tty", "r");
          if (!tty_stream)
-           error (1, errno, "/dev/tty");
+           error (1, errno, _("failed to open /dev/tty for reading"));
        }
       fputs ("?...", stderr);
       fflush (stderr);
@@ -1090,7 +1090,7 @@ xargs_do_exec (struct buildcmd_control *ctl, struct 
buildcmd_state *state)
       wait_for_proc (false, 0u);

       if (pipe(fd))
-       error (1, errno, "could not create pipe before fork");
+       error (1, errno, _("could not create pipe before fork"));
       fcntl(fd[1], F_SETFD, FD_CLOEXEC);

       /* If we run out of processes, wait for a child to return and
--
1.6.5.2.351.g0943




reply via email to

[Prev in Thread] Current Thread [Next in Thread]