[Top][All Lists]

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

[Bug-gnulib] GNU gettext support for format strings

From: Bruno Haible
Subject: [Bug-gnulib] GNU gettext support for format strings
Date: Mon, 1 Dec 2003 15:03:24 +0100
User-agent: KMail/1.5

Hi Jim,

IIRC, some time ago you mentioned that writing

  error (0, 0, "%s", _("some error occurred"))

was safer than

  error (0, 0, _("some error occurred"))

because if the translator mistakenly introduced a % sign in the translation,
the second snippet is likely to crash whereas the first one is not.

This is no longer a good argument: The just-released GNU gettext 0.13 now
recognizes format strings depending on the position in the containing
function call. If you add


to the XGETTEXT_OPTIONS in your po/Makevars file, the string
"some error occurred" will get marked as "#, c-format" in the POT file,
and when a translator mistakenly uses a % sign in his translation, the
Translation Project's robot will reject the translator's PO file. And
even if the robot didn't catch it, the next msgmerge invocation would
mark the message as "#, fuzzy" - and the message doesn't end up in the
.mo file.

So, there is no reason any more to treat error messages without arguments
differently than error messages with arguments.


reply via email to

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