Patch for MsgBase was [jsword-devel] MsgBase bug

Joe Walker jsword-devel@crosswire.org
Sat, 10 Apr 2004 20:43:44 +0100


Checked-in now.
Along with quite a bit of i18n work. I turned on non-i18n warnings and 
deprecated LogicError and watched in horror as the warnings went from 0 
to over 4000!

We're back to 500 now, but they are the harder ones.

I've not been doing the whole job; I'm only moving the english strings 
to a Msg file - so it would make sense to invent a macro to finish the 
job at some stage.

Thought: Is there any good reason why MsgBase is-a Enum?
I think there are some interesting possibilities in being able to write 
a GUI to allow users to create i18n files for themselves and this 
requires that MsgBase collects the i18n-able strings in some way, but I 
suspect Enum isn't the right solution given the previously noted 
inheritance problems.
In addition it would make sense to make MsgBase as lightweight as 
possible. So I'm tempted to make MsgBase keep track of the name itself 
without needing a parent, and to make it keep track of all i18n-able 
strings better than Enum does.

Another thought: Create proxies around the entire swing API and the 
alter the parameters of all methods that display their strings to take 
MsgBase - more enforced i18n. You could also create a second 
implementation along the same lines, but that called SwingWT instead.
I don't propose doing anything about this idea at all but it did seem neat.

Joe.

DM Smith wrote:
> Joe Walker writes:
>> Thanks for this. I've not had change to look at it, and to be honest I 
>> doubt I will this evening, and I'm likely to be a bit short of time 
>> tomorrow evening too. Sorry.
>> I'll apply it as soon as I can.
> 
> No problem. Take your time. I know that sometimes the software that I 
> write is non-trivial and takes some looking at to understand.