From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29999 invoked by alias); 9 Jan 2006 10:12:18 -0000 Received: (qmail 29991 invoked by uid 22791); 9 Jan 2006 10:12:17 -0000 X-Spam-Check-By: sourceware.org Received: from tully.CS.Berkeley.EDU (HELO tully.CS.Berkeley.EDU) (128.32.153.227) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Jan 2006 10:12:15 +0000 Received: from tully.CS.Berkeley.EDU (localhost [127.0.0.1]) by tully.CS.Berkeley.EDU (8.12.7/8.12.7/3.141592645) with ESMTP id k09A4Q7T021381; Mon, 9 Jan 2006 02:04:26 -0800 (PST) Received: from tully.CS.Berkeley.EDU (hilfingr@localhost) by tully.CS.Berkeley.EDU (8.12.7/8.12.7/Submit) with ESMTP id k09A4PXA021378; Mon, 9 Jan 2006 02:04:26 -0800 (PST) Message-Id: <200601091004.k09A4PXA021378@tully.CS.Berkeley.EDU> To: Eli Zaretskii cc: gdb-patches@sourceware.org, Hilfinger@adacore.com Subject: Re: [commit] Internationalize Ada files Reply-To: Hilfinger@CS.Berkeley.EDU In-reply-to: Your message of Sun, 08 Jan 2006 21:32:31 +0200. MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21374.1136801065.1@tully.CS.Berkeley.EDU> Date: Mon, 09 Jan 2006 10:12:00 -0000 From: Paul Hilfinger Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00095.txt.bz2 [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