This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: gcc/cp/pt.c: use ngettext() when needed


2010/2/17 Gabriel Dos Reis <dosreis@gmail.com>:
> On Wed, Feb 17, 2010 at 9:23 AM, Marco Poletti <poletti.marco@gmail.com> wrote:
>> In the file pt.c, there were translatable strings like "redeclared
>> with %d template parameter(s)" that are hard to translate.
>> Instead, it should use the ngettext() function to allow more flexible
>> translations.
>> I've added two functions inform_translated() and error_translated() to
>> diagnostic.c, that are called by pt.c.
>> This is my second patch to GCC, I could have done something wrong.
>> Critics are very appreciated.
>
> I'm uncomfortable with adding these two functions.
> It is possible to just call a preprocessor ngettext() first and give the
> result to error() or inform()?
>

Can you explain better? What do you mean with "preprocessor ngettext()"?
If you mean implementing ngettext() with the preprocessor, it's too
complicated IMHO.

However, you should not pass the ngettext() output to error() or
inform() because they call diagnostic_set_info() that would attempt to
translate the string again.
A similar solution is already used in collect2.c BTW.


Marco Poletti


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