bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gettext, msgfmt -c printf reordering


From: Andreas Schwab
Subject: Re: gettext, msgfmt -c printf reordering
Date: Mon, 22 Apr 2002 21:19:09 +0200
User-agent: Gnus/5.090005 (Oort Gnus v0.05) Emacs/21.2.50 (ia64-suse-linux)

Werner Koch <address@hidden> writes:

|> On Mon, 22 Apr 2002 17:29:05 +0200, Andreas Schwab said:
|> 
|> > You didn't specify a position for "*" in "%1$.*s".
|> 
|> Can you give me a hint on how to do that?  The glibc manual does not
|> give a hint on this:
|> 
|>      % [ PARAM-NO $] FLAGS WIDTH [ . PRECISION ] TYPE CONVERSION
|> 
|> Posix says, one should do something like this:
|> 
|>    printf("%1$d:%2$.*3$d:%4$.*3$d\n", hour, min, precision, sec);
|> 
|> However it does not work for me:
|> 
|> #: g10/passphrase.c:521
|> #, c-format
|> msgid ""
|> "You need a passphrase to unlock the secret key for user:\n"
|> "\"%.*s\"\n"
|> "%u-bit %s key, ID %08lX, created %s%s\n"
|> msgstr ""
|> "Necesita una contraseña para desbloquear la clave secreta\n"
|> "del usuario: \"%1$.*2$s\"\n"
|> "clave %4$s de %3$u bits, ID %5$08lX, creada el %6$s%7$s\n"

Swap 1$ and 2$, the precision argument appears before the string argument
in the non-positional case.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



reply via email to

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