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"),...).

Perhaps we could take a leaf out of Acorn's book here: for I18N purposes,
their RISC OS contained a module called MessageTrans, which looked up text
tokens in a text file. You would call a lookup function with an argument
like this:

lookup("RelocateFailed:Relocation failure - unable to relocate %0 due to
%1", filename, reason)

It would attempt to find a string with the token "RelocateFailed" in the
dictionary, and if this failed, would fall back to the default (the string
following the colon). A similar mechanism would appear suitable here?


James.

Reply via email to