On Sun, 21 May 2000, James Sutherland wrote:
> On Sun, 21 May 2000, Dimitrie O. Paun wrote:
>
> > On Sun, 21 May 2000, Andreas Mohr wrote:
> >
> > > I know that this approach isn't optimal. But can that be improved somehow ?
> > > By using such a file we could add localized error messages easily, too.
> >
> > Just use the format string as the key. Why introduce a number that must be
> > maintained by hand?
>
> Good idea. How about an abbreviated string, though? If we have a lookup
> function wine_error_name(char*), we could use
> FIXME(wine_error_name("RelocateFailed"),...).
There no need for an explicit wine_error_name, or any change to the source
code. If we want to do something like this, we could hide all that in the
FIXME/ERR/WARN implementation.
I still maintain the current format string is all we need (nothing more,
nothing less) -- if we fail to find something on the lookup, we can still
display a perfectly good error message. So we can use code like this:
const char *new_str = lookup(str);
if(new_str) str = new_str;
//display str
This would allow to translate/expand (the scheme can also be use to expand
the description of an error message), only a selected few that we deem
worthwhile.
--
Dimi.