bug-gnulib
[Top][All Lists]
Advanced

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

Re: xstrtol.h


From: Bruno Haible
Subject: Re: xstrtol.h
Date: Sun, 22 Jul 2007 13:03:32 +0200
User-agent: KMail/1.5.4

Hi Jim,

> What do you suggest to use as those strings?
> I.e., are you suggesting to convert each of the 5 uses of
> STRTOL_FATAL_ERROR in coreutils from e.g.,
> 
>   STRTOL_FATAL_ERROR (optarg, _("skip argument"), s_err);
> 
> to
> 
>   STRTOL_FATAL_ERROR (optarg,
>                       _("invalid skip argument `%s'"),
>                       _("invalid character following skip argument in `%s'"),
>                       _("skip argument `%s' too large"),
>                       s_err);

Yes, this is what I'm proposing. This one is at least translatable:
  - "invalid block size `%s'"     =>    "ungültige Blockgröße «%s»"
  - "invalid skip argument `%s'"  =>    "ungültiges Lückenargument «%s»"

And as a side note: Translators understand "skip argument", as if 'skip' was
verb, leading to a completely unintelligible message. The German translation
interprets it like "to skip argument", the French translation like
"skipped argument".

> It doesn't seem justifiable to do that to the code solely
> to emit marginally improved diagnostics.

"Marginally improved"?! I bet if you were to use a program written by a
Chinese author and localized to English in the same way as through
babelfish:
      "invalid jumps the argument `%s'"
you would see it differently.

But in this particular case, there is also a different possibility, that
also improves the quality of the English message. (You are using "skip"
as a noun. But what is "a skip"?) Namely, make it behave like

  STRTOL_FATAL_ERROR (optarg,
                      _("invalid --skip-bytes argument `%s'"),
                      _("invalid character following --skip-bytes argument in 
`%s'"),
                      _("--skip-bytes argument `%s' too large"),
                      s_err);

It is clearer what the message is referring to. And also --skip-bytes is a
string that does not require translation, therefore the macro invocation
actually can read

  STRTOL_FATAL_ERROR (optarg, "--skip-bytes", s_err);

All uses of STRTOL_FATAL_ERROR are in this category:

./src/od.c:         STRTOL_FATAL_ERROR (optarg, _("skip argument"), s_err);
--skip-bytes argument

./src/od.c:         STRTOL_FATAL_ERROR (optarg, _("limit argument"), s_err);
--read-bytes argument

./src/od.c:             STRTOL_FATAL_ERROR (optarg, _("minimum string length"), 
s_err);
--strings argument

./src/od.c:             STRTOL_FATAL_ERROR (optarg, _("width specification"), 
s_err);
--width argument

./src/pr.c:    _STRTOL_ERROR (EXIT_FAILURE, pages, _("page range"), err);
./src/pr.c:     _STRTOL_ERROR (EXIT_FAILURE, pages, _("page range"), err);
--pages argument

./src/sort.c:  STRTOL_FATAL_ERROR (s, _("sort size"), e);
--buffer-size argument

./src/df.c:       human_output_opts = human_options (optarg, true, 
&output_block_size);
--block-size argument

./src/du.c:       human_output_opts = human_options (optarg, true, 
&output_block_size);
--block-size argument

./src/ls.c:       human_output_opts = human_options (optarg, true, 
&output_block_size);
--block-size argument

I can prepare a patch for this; just let me know whether for
   $ od -j -1
you would see the error message
   od: invalid --skip-bytes argument `-1'
or
   od: invalid `-j' argument `-1'

Bruno





reply via email to

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