[Bug c++/18248] c_parse_error i18n problems

2011-12-14 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18248

Manuel López-Ibáñez  changed:

   What|Removed |Added

 CC||niva at niisi dot msk.ru

--- Comment #4 from Manuel López-Ibáñez  2011-12-14 
09:44:16 UTC ---
*** Bug 51548 has been marked as a duplicate of this bug. ***


[Bug c++/18248] c_parse_error i18n problems

2004-12-06 Thread pinskia at gcc dot gnu dot org


-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Last reconfirmed|-00-00 00:00:00 |2004-12-06 22:04:21
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18248


[Bug c++/18248] c_parse_error i18n problems

2004-10-31 Thread gdr at cs dot tamu dot edu

--- Additional Comments From gdr at cs dot tamu dot edu  2004-10-31 14:11 ---
Subject: Re:  c_parse_error i18n problems

"joseph at codesourcery dot com" <[EMAIL PROTECTED]> writes:

| Subject: Re:  c_parse_error i18n problems
| 
| On Sun, 31 Oct 2004, gdr at cs dot tamu dot edu wrote:
| 
| > Notice that in all the cases where the sentences are combined, the
| > parts all come from string lietrals.  There ought to be a way to have
| > the compiler build those (kind of compile-time introspection facilities).
| 
| It's not the compiler that would need to build them, it's exgettext.  

Either of them, it depends on your perspective :-).

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18248


[Bug c++/18248] c_parse_error i18n problems

2004-10-31 Thread joseph at codesourcery dot com

--- Additional Comments From joseph at codesourcery dot com  2004-10-31 10:58 
---
Subject: Re:  c_parse_error i18n problems

On Sun, 31 Oct 2004, gdr at cs dot tamu dot edu wrote:

> Notice that in all the cases where the sentences are combined, the
> parts all come from string lietrals.  There ought to be a way to have
> the compiler build those (kind of compile-time introspection facilities).

It's not the compiler that would need to build them, it's exgettext.  
We've improved on xgettext's defaults with that wrapper which looks for 
parameters called msgid, but at a certain point you reach excess 
complexity and it would be better to write the source code in a more 
i18n-friendly way.

One possibility I considered to avoid eight sentences everywhere is an 
additional format escape, say %K, which takes a token as argument; a new 
structure to store both token type and value as a single argument would be 
needed.  The messages would then be of the form "expected ';' before %K".  
The trouble with this is that the token descriptions in c_parse_error 
include pieces of English text as well as actual token text; though it 
might be possible to change things so that the original token text from 
cpplib is available for diagnostics and use something like "before " 
in place of "at end of input" so all the messages use a single form.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18248


[Bug c++/18248] c_parse_error i18n problems

2004-10-31 Thread gdr at cs dot tamu dot edu

--- Additional Comments From gdr at cs dot tamu dot edu  2004-10-31 10:44 ---
Subject: Re:  New: c_parse_error i18n problems

"jsm28 at gcc dot gnu dot org" <[EMAIL PROTECTED]> writes:

| c_parse_error combines a string passed in with another part of a
| sentence.  Combining sentence fragments cannot work with i18n.  The
| source code must contain all the full sentences output even though this
| bulks up the source by needing 8 different "expected .. before ..." in the
| error function call for every parser error: only that way can all the
| sentences be translated properly.  Making each call pass eight arguments
| rather than one is fortunately a fairly mechanical change, as the new
| arguments are derived from the existing one in a fixed way.

Notice that in all the cases where the sentences are combined, the
parts all come from string lietrals.  There ought to be a way to have
the compiler build those (kind of compile-time introspection facilities).

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18248