bug-gnulib
[Top][All Lists]
Advanced

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

Re: xstrtol.h


From: Jim Meyering
Subject: Re: xstrtol.h
Date: Sun, 22 Jul 2007 00:41:03 +0200

Bruno Haible <address@hidden> wrote:
> Eric Blake wrote:
>> > The lib/gettext.h file already arranges for this (with the i18n domain name
>> > being not just "gnulib", but "findutils-gnulib" or similar).
>>
>> That won't work in headers.  For .c files, they are compiled as part of
>> the gnulib library, where the DEFAULT_TEXT_DOMAIN is in effect.  But for
>> the .h files, such as xstrtol.h, they are compiled as part of the main
>> program, where gettext() is no longer a macro to the <pobase>-domain.  It
>> looks like we'll have to edit any use of gettext in gnulib headers to
>> instead use something from a .c file
>
> There is only one use of gettext() in header files in gnulib, the one in
> xstrtol.h, and it needs to be revised anyway: It violates the principle
> that the translator must be presented whole sentences. Things like
>
>   gettext ("invalid %s `%s'")
>
> where the first %s comes from
>
>   STRTOL_FATAL_ERROR (spec, _("block size"), e);
>
> are not translatable to languages (such as German), where the adjective's
> flexion depends on the gender of the noun.
>
> The macro should be rewritten to take three localized strings as arguments,
> instead of just one.

Hi Bruno,

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);

That sort of "unfactoring" would be hard for me to swallow.
It doesn't seem justifiable to do that to the code solely
to emit marginally improved diagnostics.




reply via email to

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