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]

Re: other/2857: i18n, translations does not work


On Tue, May 22, 2001 at 09:49:45PM +0200, Gabriel Dos Reis wrote:
> "Zack Weinberg" <zackw@stanford.edu> writes:
> | 
> | So I look through diagnostic.c, and almost none of the functions that
> | are supposed to run their 'msgid' argument through gettext(3) actually
> | do.  This is not that hard to fix, except that diagnostic.c is a mess.
> 
> Yes, diagnostic.c is a mess and plans are to clean it.

Can you share some of these plans (better in a fresh thread)?  One of
my near-future things to do is try to wire cpplib into diagnostic.c
for C front ends, so that we can get column numbers.

> | I think the appended patch hits all the places that need to get hit,
> | but maybe Gabriel could take a close look?  The tweaks to argument
> | names enforce the principle that a 'const char *msgid' is either run
> | through gettext or passed to a function which will run it through
> | gettext.
> 
> OK.

Is this an approval?

> Is there a reason why vnotice should go that way (I'm not saying, that
> is wrong, I'm wanting to know because the long-term plan is to have no
> (or very few) functions putting text directly into stderr or variants.
> They should run texts through the machinery.

I took out vnotice because it was only used from fnotice and it seemed
unlikely that any new users would be created later.  If I understand
you correctly, you confirm this belief.

The places where I added calls to fnotice were previously using
fprintf(stderr).  One of them could be changed to plain error, the
rest perhaps to verbatim, except for error_recursion.  That one needs
to use stdio directly, because the only way we get there is if data
structures are trashed, it may not be safe to use verbatim or the
like.  (It certainly wasn't safe to use internal_error, which would
turn around and call error_recursion again, repeat until
diagnostic_lock wraps round or we run out of stack.)

I can change the fnotice calls, but I think that should be a separate
patch.  This needs to go in ASAP if we want functional translation
machinery in 3.0.

-- 
zw   The beginning of almost every story is actually a bone, something with
     which to court the dog, which may bring you closer to the lady.
     	-- Amos Oz, _The Story Begins_


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