Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, Hilfinger@adacore.com
Subject: Re: [commit] Internationalize Ada files
Date: Mon, 09 Jan 2006 10:12:00 -0000	[thread overview]
Message-ID: <200601091004.k09A4PXA021378@tully.CS.Berkeley.EDU> (raw)
In-Reply-To: Your message of Sun, 08 Jan 2006 21:32:31 +0200.              <uu0cesegg.fsf@gnu.org>


[Reconstructing some comments that got bounced.]

> 
> >  yyerror (char *msg)
> >  {
> > -  error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
> > +  error (_("A %s in expression, near `%s'."), (msg ? msg : _("error")), lexptr);
> >  }
> 
> I agree with Andreas here: it would be very hard to translate this
> message correctly.  Perhaps this message should have been rewritten as
> 2 different messages: one when msg is NULL, the other when it isn't.

True; even without i18n, this line has a problem.  However, it was
copied directly from c-exp.y in the dim, dark past, so this problem
occurs elsewhere.  Furthermore, there is another problem with it.  The
caller of yyerror is the bison framework.  Its calls are not
internationalized at the moment.  One solution might be to simply
ignore msg altogether, which is 'syntax error' or the like almost all the
time, and indicates storage exhausted otherwise.

> > -          error (_("Attempt to index or call something other than an \
> > -array or function"));
> > +          error (_("Attempt to index or call something other than an "
> > +		   "array or function"));
> 
> Does xgettext support strings broken between 2 lines?

Yes, but I see from the documentation that they result in
"non-canonical" msgid entries.  I asked myself the same question
before doing this and found (via grep '_(.*" *$' that there are
several non-Ada files with this same construct.

> >            ada_to_fixed_value (unwrap_value
> >                                (ada_value_struct_elt
> > -                               (arg1, &exp->elts[pc + 2].string, "record")));
> > +                               (arg1, &exp->elts[pc + 2].string, _("record"))));
> 
> Do we really want to translate the "record" part here?  Could you
> please tell what would the string produced by this call to
> ada_to_fixed_value look like in English?

Yes, we should translate "record", I think.  The result string is 

       Bad value type in a record.

(which could stand to be improved) or

       Attempt to extract a component of a value that is not a record.

The code is analogous to value_struct_elt.  Now I notice that the
corresponding parameters in calls to that function are NOT translated, 
but that seems wrong to me, considering what they mean.  For example,
we have

      argvec[0] = value_struct_elt (&temp, argvec + 1, tstr,
				    &static_memfuncp,
				    op == STRUCTOP_STRUCT
			       ? "structure" : "structure pointer");

in eval.c.  Since value_struct_elt in valops.c contains

    error (_("Attempt to extract a component of a value that is not a %s."), 
           err);

we will see dual-language messages if we don't translate "structure"
and "structure pointer".

Paul Hilfinger




      reply	other threads:[~2006-01-09 10:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-08  7:22 Paul Hilfinger
2006-01-08 11:12 ` Andreas Schwab
2006-01-08 19:32 ` Eli Zaretskii
2006-01-09 10:12   ` Paul Hilfinger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200601091004.k09A4PXA021378@tully.CS.Berkeley.EDU \
    --to=hilfingr@eecs.berkeley.edu \
    --cc=Hilfinger@CS.Berkeley.EDU \
    --cc=Hilfinger@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox