This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commit] Internationalize Ada files


[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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]