This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/7765 [Patch]
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Wolfgang Bangerth <wolfgang dot bangerth at iwr dot uni-heidelberg dot de>
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org,Michel Robitaille <robitail at iro dot umontreal dot ca>
- Date: Mon, 28 Oct 2002 09:59:23 -0800
- Subject: Re: c++/7765 [Patch]
- References: <20021028163245.GA24090@codesourcery.com> <Pine.SOL.4.10.10210281737130.5316-100000@eris>
On Mon, Oct 28, 2002 at 05:47:49PM +0100, Wolfgang Bangerth wrote:
>
> Zack, Michel,
>
> > If this weren't in the translations it would qualify as an obvious
> > bugfix. I would say, go ahead and check it in (with this change);
>
> I can't, someone has to do that for me. Note also the changed comment in
> the patch, I believe the old one had an "and" and "or" confused.
Okay. I will apply your comment change shortly, and use your script
to audit the .po files and clean them up.
> I'm presently about to do just that, with a small script. There are
> literally dozens of such cases in the danish translation, and at least ten
> more in the french one, where formats don't match (things are a little bit
> complicated, since a % might be followed by a charater that needs to be
> escaped in perl...).
Joy.
> I'm surprised nobody's been paying attention to this rather obvious
> problem.
msgfmt has logic to check for this stuff, but we can't use it because
it only knows about printf %-escapes, not our extensions. And it
doesn't reliably know which strings are going to undergo printf
processing. (The built-in heuristic of scanning strings for %[a-z] is
worse than useless, because a translation may introduce a % where
there wasn't one before.)
> Also, do I understand you correctly that the
> _order_ of formats needs to be preserved? (One would think so if things
> are called via functions with an ellipsis at the end.) This is going to be
> a headache for translators, because it restricts their choice of wording,
> and it can also not be checked automatically, if the same format appears
> more than once in the text.
Yes, the order of formats must presently be preserved. I realize that
this interferes with proper translation. What we need to do is
implement the SVR4 "%1$x" printf extension: this allows you to write
msgid "statement about %d %s"
msgstr "statement about %2$s in quantity %1$d"
(I will get to this eventually, but the list of things I will get to
eventually has items on it from 1998, so don't hold your breath.
Patches for diagnostic.c are welcome.)
zw