[Mono-list] Resource System Proposal
Rhys Weatherley
rweather@zip.com.au
Mon, 19 Nov 2001 23:02:34 +1000
Guy Murphy wrote:
> As for bringing the fruits of Unix internationalisation to .NET, are you
> porting .NET or redesigning it?... I speak with specific regard to the
> spec.... there's a .NET way of doing internationalisation, and that's the
> one that matters in this case. Some of the .NET methodologies will be better
> than others when compaired to other frameworks... but if you start
> "improving" .NET beyond it's spec what'll you'll end up with won't be .NET
As described in my original proposal document (URL below),
.NET already does have a way of doing internationalization.
However, it is clumsy to use in its current form, requiring
the programmer to wrap it up in private convenience libraries
to make it manageable. Even Microsoft wraps it up.
Instead of every assembly doing its own thing, the proposal
is to pick the most convenient way to wrap it up and then do
it once and for all. This has several benefits: tool support is
easier, coding standards are easier to enforce, and replacing
it with a completely different system at some future time
is trivial. This convenience library can be re-distributed
with applications so that they run on existing engines.
The original .NET API's for internationalisation will be
fully supported, and any programmer who wants to expend
the effort of doing it the long way can do so. But I believe
that internally within our own libraries, we should be
doing something better.
I suggest that anyone who thinks that the .NET system
is OK go off and write 250+ C# classes, complete with
resources, using Microsoft's API's. For added pain,
do it yourself. One person. No one else helping you.
I've done this with pnetlib: it is fully translation-ready,
and 99.9999% written by me. And it was a monumental
pain to pull out all those resources and then write
'Environment.GetResourceString("tag")' for the 1000'th
time. I'd sell my soul for the "_" keyword about now. :-)
And that's *after* wrapping up the .NET API's in a way
similar to Microsoft's method. Try this on for size:
(new ResourceManager
(Assembly.GetExecutingAssembly().Name,
Assembly.GetExecutingAssembly()))
.GetString("tag")
That's what it would look like with no wrapping at all.
The .NET API's are not convenient to use. They are
building blocks that need to be wrapped to be useful.
I'd like to see them wrapped one way, and not 100's
of different ways.
Cheers,
Rhys.
The Proposal: http://www.southern-storm.com.au/l10n.html
pnetlib: http://www.southern-storm.com.au/portable_net_lib.html