* [commit] Internationalize Ada files
@ 2006-01-08 7:22 Paul Hilfinger
2006-01-08 11:12 ` Andreas Schwab
2006-01-08 19:32 ` Eli Zaretskii
0 siblings, 2 replies; 4+ messages in thread
From: Paul Hilfinger @ 2006-01-08 7:22 UTC (permalink / raw)
To: gdb-patches
I have committed the following trivial change to the Ada files.
Paul Hilfinger
Changelog:
2006-01-07 Paul N. Hilfinger <hilfinger@adacore.com>
* ada-exp.y, ada-lex.l, ada-typeprint.c: I18n markup.
* ada-tasks.c, ada-lang.c: I18n markup.
Editorial: change "can not" => "cannot" throughout.
Index: gdb/ada-exp.y
===================================================================
RCS file: /cvs/src/src/gdb/ada-exp.y,v
retrieving revision 1.17
diff -u -p -r1.17 ada-exp.y
--- gdb/ada-exp.y 2 Jan 2006 10:38:03 -0000 1.17
+++ gdb/ada-exp.y 8 Jan 2006 07:16:41 -0000
@@ -252,7 +252,7 @@ primary : primary '(' arglist ')'
if ($1 != NULL)
{
if ($3 != 1)
- error ("Invalid conversion");
+ error (_("Invalid conversion"));
write_exp_elt_opcode (UNOP_CAST);
write_exp_elt_type ($1);
write_exp_elt_opcode (UNOP_CAST);
@@ -270,7 +270,7 @@ primary : var_or_type '\'' save_qualifie
'(' exp ')'
{
if ($1 == NULL)
- error ("Type required for qualification");
+ error (_("Type required for qualification"));
write_exp_elt_opcode (UNOP_QUAL);
write_exp_elt_type ($1);
write_exp_elt_opcode (UNOP_QUAL);
@@ -288,7 +288,7 @@ primary :
{ if ($1 == NULL)
write_exp_elt_opcode (TERNOP_SLICE);
else
- error ("Cannot slice a type");
+ error (_("Cannot slice a type"));
}
;
@@ -356,7 +356,7 @@ simple_exp : '{' var_or_type '}' simple_
/* GDB extension */
{
if ($2 == NULL)
- error ("Type required within braces in coercion");
+ error (_("Type required within braces in coercion"));
write_exp_elt_opcode (UNOP_MEMVAL);
write_exp_elt_type ($2);
write_exp_elt_opcode (UNOP_MEMVAL);
@@ -426,7 +426,7 @@ relation : simple_exp IN simple_exp DOTD
| simple_exp IN var_or_type %prec TICK_ACCESS
{
if ($3 == NULL)
- error ("Right operand of 'in' must be type");
+ error (_("Right operand of 'in' must be type"));
write_exp_elt_opcode (UNOP_IN_RANGE);
write_exp_elt_type ($3);
write_exp_elt_opcode (UNOP_IN_RANGE);
@@ -444,7 +444,7 @@ relation : simple_exp IN simple_exp DOTD
| simple_exp NOT IN var_or_type %prec TICK_ACCESS
{
if ($4 == NULL)
- error ("Right operand of 'in' must be type");
+ error (_("Right operand of 'in' must be type"));
write_exp_elt_opcode (UNOP_IN_RANGE);
write_exp_elt_type ($4);
write_exp_elt_opcode (UNOP_IN_RANGE);
@@ -557,7 +557,7 @@ type_prefix :
var_or_type
{
if ($1 == NULL)
- error ("Prefix must be type");
+ error (_("Prefix must be type"));
write_exp_elt_opcode (OP_TYPE);
write_exp_elt_type ($1);
write_exp_elt_opcode (OP_TYPE); }
@@ -602,7 +602,7 @@ primary : STRING
;
primary : NEW NAME
- { error ("NEW not implemented."); }
+ { error (_("NEW not implemented.")); }
;
var_or_type: NAME %prec VAR
@@ -768,7 +768,7 @@ ada_parse (void)
void
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);
}
/* The operator name corresponding to operator symbol STRING (adds
@@ -796,7 +796,7 @@ string_to_operator (struct stoken string
return string;
}
}
- error ("Invalid operator symbol `%s'", string.ptr);
+ error (_("Invalid operator symbol `%s'"), string.ptr);
}
/* Emit expression to access an instance of SYM, in block BLOCK (if
@@ -856,7 +856,7 @@ write_object_renaming (struct block *ori
enum { SIMPLE_INDEX, LOWER_BOUND, UPPER_BOUND } slice_state;
if (max_depth <= 0)
- error ("Could not find renamed symbol");
+ error (_("Could not find renamed symbol"));
/* if orig_left_context is null, then use the currently selected
block; otherwise we might fail our symbol lookup below. */
@@ -887,7 +887,7 @@ write_object_renaming (struct block *ori
name[suffix-expr] = '\000';
sym = lookup_symbol (name, orig_left_context, VAR_DOMAIN, 0, NULL);
if (sym == NULL)
- error ("Could not find renamed variable: %s", ada_decode (name));
+ error (_("Could not find renamed variable: %s"), ada_decode (name));
if (ada_is_object_renaming (sym))
write_object_renaming (orig_left_context, sym, max_depth-1);
else
@@ -943,7 +943,7 @@ write_object_renaming (struct block *ori
index_sym =
lookup_symbol (index_name, NULL, VAR_DOMAIN, 0, NULL);
if (index_sym == NULL)
- error ("Could not find %s", index_name);
+ error (_("Could not find %s"), index_name);
write_var_from_sym (NULL, block_found, sym);
}
if (slice_state == SIMPLE_INDEX)
@@ -989,7 +989,7 @@ write_object_renaming (struct block *ori
return;
BadEncoding:
- error ("Internal error in encoding of renaming declaration: %s",
+ error (_("Internal error in encoding of renaming declaration: %s"),
SYMBOL_LINKAGE_NAME (renaming));
}
@@ -1021,14 +1021,14 @@ block_lookup (struct block *context, cha
else if (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK)
{
if (context == NULL)
- error ("No file or function \"%s\".", raw_name);
+ error (_("No file or function \"%s\"."), raw_name);
else
- error ("No function \"%s\" in specified context.", raw_name);
+ error (_("No function \"%s\" in specified context."), raw_name);
}
else
{
if (nsyms > 1)
- warning ("Function name \"%s\" ambiguous here", raw_name);
+ warning (_("Function name \"%s\" ambiguous here"), raw_name);
return SYMBOL_BLOCK_VALUE (syms[0].sym);
}
}
@@ -1210,7 +1210,7 @@ write_var_or_type (struct block *block,
struct type *type = SYMBOL_TYPE (type_sym);
if (TYPE_CODE (type) == TYPE_CODE_VOID)
- error ("`%s' matches only void type name(s)", name0.ptr);
+ error (_("`%s' matches only void type name(s)"), name0.ptr);
else if (ada_is_object_renaming (type_sym))
{
write_object_renaming (block, type_sym,
@@ -1238,7 +1238,7 @@ write_var_or_type (struct block *block,
else if (tail_index == name_len)
return type;
else
- error ("Invalid attempt to select from type: \"%s\".", name0.ptr);
+ error (_("Invalid attempt to select from type: \"%s\"."), name0.ptr);
}
else if (tail_index == name_len && nsyms == 0)
{
@@ -1271,7 +1271,7 @@ write_var_or_type (struct block *block,
if (tail_index == name_len
&& strncmp (encoded_name, "standard__",
sizeof ("standard__") - 1) == 0)
- error ("No definition of \"%s\" found.", name0.ptr);
+ error (_("No definition of \"%s\" found."), name0.ptr);
tail_index = chop_selector (encoded_name, tail_index);
}
@@ -1284,16 +1284,16 @@ write_var_or_type (struct block *block,
}
if (!have_full_symbols () && !have_partial_symbols () && block == NULL)
- error ("No symbol table is loaded. Use the \"file\" command.");
+ error (_("No symbol table is loaded. Use the \"file\" command."));
if (block == expression_context_block)
- error ("No definition of \"%s\" in current context.", name0.ptr);
+ error (_("No definition of \"%s\" in current context."), name0.ptr);
else
- error ("No definition of \"%s\" in specified context.", name0.ptr);
+ error (_("No definition of \"%s\" in specified context."), name0.ptr);
TryAfterRenaming: ;
}
- error ("Could not find renamed symbol \"%s\"", name0.ptr);
+ error (_("Could not find renamed symbol \"%s\""), name0.ptr);
}
@@ -1327,7 +1327,7 @@ write_name_assoc (struct stoken name)
}
else
if (write_var_or_type (NULL, name) != NULL)
- error ("Invalid use of type.");
+ error (_("Invalid use of type."));
}
/* Convert the character literal whose ASCII value would be VAL to the
Index: gdb/ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.82
diff -u -p -r1.82 ada-lang.c
--- gdb/ada-lang.c 2 Jan 2006 09:46:34 -0000 1.82
+++ gdb/ada-lang.c 8 Jan 2006 07:16:43 -0000
@@ -4352,7 +4352,7 @@ is_package_name (const char *name)
"_ada_" followed by NAME can be found. */
/* Do a quick check that NAME does not contain "__", since library-level
- functions names can not contain "__" in them. */
+ functions names cannot contain "__" in them. */
if (strstr (name, "__") != NULL)
return 0;
@@ -6827,7 +6827,7 @@ to_fixed_array_type (struct type *type0,
debugging data. */
/* Create a fixed version of the array element type.
We're not providing the address of an element here,
- and thus the actual object value can not be inspected to do
+ and thus the actual object value cannot be inspected to do
the conversion. This should not be a problem, since arrays of
unconstrained objects are not allowed. In particular, all
the elements of an array of a tagged type should all be of
@@ -6855,7 +6855,7 @@ to_fixed_array_type (struct type *type0,
debugging data. */
/* Create a fixed version of the array element type.
We're not providing the address of an element here,
- and thus the actual object value can not be inspected to do
+ and thus the actual object value cannot be inspected to do
the conversion. This should not be a problem, since arrays of
unconstrained objects are not allowed. In particular, all
the elements of an array of a tagged type should all be of
@@ -7692,7 +7692,7 @@ aggregate_assign_positional (struct valu
LONGEST ind = longest_to_int (exp->elts[*pos + 1].longconst) + low;
if (ind - 1 == high)
- warning ("Extra components in aggregate ignored.");
+ warning (_("Extra components in aggregate ignored."));
if (ind <= high)
{
add_component_interval (ind, ind, indices, num_indices, max_indices);
@@ -8145,8 +8145,8 @@ ada_evaluate_subexp (struct type *expect
nargs, argvec + 1));
default:
- 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"));
}
case TERNOP_SLICE:
@@ -8239,8 +8239,8 @@ array or function"));
switch (TYPE_CODE (type))
{
default:
- lim_warning (_("Membership test incompletely implemented; \
-always returns true"));
+ lim_warning (_("Membership test incompletely implemented; "
+ "always returns true"));
return value_from_longest (builtin_type_int, (LONGEST) 1);
case TYPE_CODE_RANGE:
@@ -8585,7 +8585,7 @@ always returns true"));
return
ada_to_fixed_value (unwrap_value
(ada_value_struct_elt
- (arg1, &exp->elts[pc + 2].string, "record")));
+ (arg1, &exp->elts[pc + 2].string, _("record"))));
case OP_TYPE:
/* The value is not supposed to be used. This is here to make it
easier to accommodate expressions that contain types. */
@@ -8608,11 +8608,11 @@ always returns true"));
{
case OP_NAME:
error (_("Undefined name, ambiguous name, or renaming used in "
- "component association: %s."), &exp->elts[pc+2].string);
+ "component association: %s."), &exp->elts[pc+2].string);
case OP_AGGREGATE:
error (_("Aggregates only allowed on the right of an assignment"));
default:
- internal_error (__FILE__, __LINE__, "aggregate apparently mangled");
+ internal_error (__FILE__, __LINE__, _("aggregate apparently mangled"));
}
ada_forward_operator_length (exp, pc, &oplen, &nargs);
Index: gdb/ada-lex.l
===================================================================
RCS file: /cvs/src/src/gdb/ada-lex.l,v
retrieving revision 1.13
diff -u -p -r1.13 ada-lex.l
--- gdb/ada-lex.l 2 Jan 2006 09:46:34 -0000 1.13
+++ gdb/ada-lex.l 8 Jan 2006 07:16:43 -0000
@@ -124,11 +124,11 @@ static int find_dot_all (const char *);
}
{NUM10}"#"{NUM16}"."{NUM16}"#"{EXP} {
- error ("Based real literals not implemented yet.");
+ error (_("Based real literals not implemented yet."));
}
{NUM10}"#"{NUM16}"."{NUM16}"#" {
- error ("Based real literals not implemented yet.");
+ error (_("Based real literals not implemented yet."));
}
<INITIAL>"'"({GRAPHIC}|\")"'" {
@@ -151,7 +151,7 @@ static int find_dot_all (const char *);
}
\" {
- error ("ill-formed or non-terminated string literal");
+ error (_("ill-formed or non-terminated string literal"));
}
@@ -264,7 +264,7 @@ xor { return XOR; }
/* CATCH-ALL ERROR CASE */
-. { error ("Invalid character '%s' in expression.", yytext); }
+. { error (_("Invalid character '%s' in expression."), yytext); }
%%
#include <ctype.h>
@@ -380,7 +380,7 @@ processInt (const char *base0, const cha
{
base = strtol (base0, (char **) NULL, 10);
if (base < 2 || base > 16)
- error ("Invalid base: %d.", base);
+ error (_("Invalid base: %d."), base);
}
if (exp0 == NULL)
@@ -391,14 +391,14 @@ processInt (const char *base0, const cha
errno = 0;
result = strtoulst (num0, (const char **) &trailer, base);
if (errno == ERANGE)
- error ("Integer literal out of range");
+ error (_("Integer literal out of range"));
if (isxdigit(*trailer))
- error ("Invalid digit `%c' in based literal", *trailer);
+ error (_("Invalid digit `%c' in based literal"), *trailer);
while (exp > 0)
{
if (result > (ULONG_MAX / base))
- error ("Integer literal out of range");
+ error (_("Integer literal out of range"));
result *= base;
exp -= 1;
}
@@ -652,10 +652,10 @@ processAttribute (const char *str)
if (k == -1)
k = i;
else
- error ("ambiguous attribute name: `%s'", str);
+ error (_("ambiguous attribute name: `%s'"), str);
}
if (k == -1)
- error ("unrecognized attribute: `%s'", str);
+ error (_("unrecognized attribute: `%s'"), str);
return attributes[k].code;
}
Index: gdb/ada-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-typeprint.c,v
retrieving revision 1.13
diff -u -p -r1.13 ada-typeprint.c
--- gdb/ada-typeprint.c 2 Jan 2006 09:39:21 -0000 1.13
+++ gdb/ada-typeprint.c 8 Jan 2006 07:16:43 -0000
@@ -380,7 +380,7 @@ print_array_type (struct type *type, str
type = ada_coerce_to_simple_array_type (type);
if (type == NULL)
{
- fprintf_filtered (stream, "<undecipherable array type>");
+ fprintf_filtered (stream, _("<undecipherable array type>"));
return;
}
if (ada_is_simple_array_type (type))
@@ -813,7 +813,7 @@ ada_print_type (struct type *type0, char
{
char *name = ada_type_name (type);
if (!ada_is_range_type_name (name))
- fprintf_filtered (stream, "<%d-byte integer>",
+ fprintf_filtered (stream, _("<%d-byte integer>"),
TYPE_LENGTH (type));
else
{
@@ -837,7 +837,7 @@ ada_print_type (struct type *type0, char
}
break;
case TYPE_CODE_FLT:
- fprintf_filtered (stream, "<%d-byte float>", TYPE_LENGTH (type));
+ fprintf_filtered (stream, _("<%d-byte float>"), TYPE_LENGTH (type));
break;
case TYPE_CODE_ENUM:
if (show < 0)
@@ -850,7 +850,7 @@ ada_print_type (struct type *type0, char
print_array_type (type, stream, show, level);
else if (ada_is_bogus_array_descriptor (type))
fprintf_filtered (stream,
- "array (?) of ? (<mal-formed descriptor>)");
+ _("array (?) of ? (<mal-formed descriptor>)"));
else
print_record_type (type, stream, show, level);
break;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [commit] Internationalize Ada files
2006-01-08 7:22 [commit] Internationalize Ada files Paul Hilfinger
@ 2006-01-08 11:12 ` Andreas Schwab
2006-01-08 19:32 ` Eli Zaretskii
1 sibling, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2006-01-08 11:12 UTC (permalink / raw)
To: Paul Hilfinger; +Cc: gdb-patches
Paul Hilfinger <hilfingr@gnat.com> writes:
> @@ -768,7 +768,7 @@ ada_parse (void)
> void
> 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);
This will be hard if not impossible to properly translate to many
languages. Even in English it is grammatically wrong when msg is NULL.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [commit] Internationalize Ada files
2006-01-08 7:22 [commit] Internationalize Ada files Paul Hilfinger
2006-01-08 11:12 ` Andreas Schwab
@ 2006-01-08 19:32 ` Eli Zaretskii
2006-01-09 10:12 ` Paul Hilfinger
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2006-01-08 19:32 UTC (permalink / raw)
To: Paul Hilfinger; +Cc: gdb-patches
> From: Paul Hilfinger <hilfingr@gnat.com>
> Date: Sun, 8 Jan 2006 02:22:09 -0500 (EST)
>
> I have committed the following trivial change to the Ada files.
Thanks. However, i18n changes are never trivial, IMHO.
> 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.
> - 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?
> 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?
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [commit] Internationalize Ada files
2006-01-08 19:32 ` Eli Zaretskii
@ 2006-01-09 10:12 ` Paul Hilfinger
0 siblings, 0 replies; 4+ messages in thread
From: Paul Hilfinger @ 2006-01-09 10:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches, Hilfinger
[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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-01-09 10:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-08 7:22 [commit] Internationalize Ada files Paul Hilfinger
2006-01-08 11:12 ` Andreas Schwab
2006-01-08 19:32 ` Eli Zaretskii
2006-01-09 10:12 ` Paul Hilfinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox