harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib] internationalization
Date Mon, 10 Jul 2006 12:37:09 GMT
Ilya Okomin wrote:
> I'd like to be a volunteer for that.

I just started working in this area (for SQL), maybe that is what
prompted you...<g>

> IMHO it's reasonable to use framework presented in luni module with some
> modifications.
> To avoid duplication of Msg class I'd suggest use slightly modified Msg
> class named let say
> o.a.h.luni.utils.ExtMsg.
> ExtMsg has the same methods as Msg, the difference is only these methods
> are
> non static,
> also specific external messages resource bundle will be initialized by name
> in the constructor.
> Each module will have class o.a.h.<module>.MsgUtils with static field 'msg'
> that is the instance of ExtMsg
> initialized with the name of the external messages resource bundle related
> to this module.
> Thus external message for e.g. security module could be obtained using next
> call:
> 
> "org.apache.harmony.security.internal.MsgUtils.msg.getString("security.1");"

I see your point, and considered doing it that way too.  I'm not overly
concerned about the duplication, they are trivial helper methods anyway,
and we all know that singletons are evil ;-)

> And at last, place to keep resources with external messages I suppose to be
> o.a.h.<module>.internal.

I went for o.a.h.<module>.internal.nls just to keep them tidy.

> If all these thoughts sounds reasonable, I'd like to implement framework
> mentioned above and send you a patch.

The real work is going through and externalizing all the messages, and
if I were to be really ambitious to add messages to all the exceptions
that we throw that don't have anything right now.

Patches are always welcome.  We can work on that that as we finalize on
the framework.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message