[jsword-devel] I18N (was: New Developer)

Joe Walker jsword-devel@crosswire.org
Sat, 27 Dec 2003 10:32:34 +0000


JSword used to use a method very similar to yours, and I found that the 
message file was constantly getting out of date with respect to the source.
There were 3 problems:
- editing properties files was a hassle
- unused messages would not be purged
- lazy developers (me!) would add an i18n key thinking "i'll add it to 
the message file later" and never do it.

The Msg system solves these problems by making the I18N type-safe - 
Exceptions take a Msg and not a String and so on.

You can now navigate to the message with a single key press in any 
decent IDE (in eclipse I just press F3)
You can detect if the message is used without lengthy search procedures 
with your IDE (ctrl+shift+g in eclipse)
The english developer can ignore message files completely because the 
messages are in the source
JSword can sill be internationalized simply by adding message files

To clear up some of the points you made:
Does this scheme waste space?
We use extra static space for a few objects that wrap strings. Only one 
copy of MsgBase is needed, and the strings themselves (the things that 
take up the real space) would exist anyway.
So yes this does waste some space, but I think that is a reasonable 
price to pay.

Joe.