"Gisle Vanem" <[EMAIL PROTECTED]> writes:

> "Hrvoje Niksic" <[EMAIL PROTECTED]> said:
>
>> Note that David's Wget seems to have printed "unknown error", not
>> "Host not found".  Is that an artifact of his version of system
>> libraries, or is Wget doing something wrong?
>
> That's because wget incorrectly uses strerror() for Winsock
> errors or uses 'errno' when that's not set.

Doesn't the host lookup code use herrmsg()?

And anyway, aren't Winsock functions supposed to set errno?  If they
don't, how does Wget report "connection refused", to name but one
example?  Wget relies on errno/strerror pretty heavily, and if that
were non-functional in such an obvious way, I'm sure someone would
have complained by now.

> The correct thing would be 
> to set 'errno' to last Winsock error and make a compatible function 
> that returns correct string for both sys-errors and WS errors. 
> E.g. we put this in mswindows.h:
>   #define strerror(err) win_strerror (err)
>   extern const char    *win_strerror (int err);

That's fine, but I'd rather not do that unless I absolutely have to.

> But the problem is that sys_errlist[] always returns English texts,

That's not true.  strerror() is more than just an index into
sys_errlist -- don't be confused by what you see in cmpt.c, that's
just for ancient systems without strerror.  In non-English locales
with translated error messages, Wget prints the translated ones.
Which is how it should be, really.

> but Windows's FormatMessage() returns in native language. So to be
> consistent

I'd like to go the other way with consistency: use gettext in Windows
builds!

> I suggest we return English also for Winsock errors (easier when we
> receive a bug-report from a user without the proper wget.gmo file.
> Who ever uses NLS anyway?).

Well, as Francois Pinard once put it, computers speak entirely too
much English.  While I personally prefer English interfaces, I like
giving the users the choice to make their applications speak in their
language.

But translations shouldn't be imposed on users who don't want them.
I'd say, *if* the user has set up Wget to use her language, also
provide translated error messages (if possible).  Otherwise, use
English, as always.

If a user submits a bug report in a foreign language that we can't
decipher, we'll kindly ask her to resubmit the report with LANG unset
-- or however you do that kind of thing in Windows.  I don't believe
it will happen often.

Reply via email to