[jboss-dev] JBoss Unified I18N Infrastructure

David Ward dward at redhat.com
Fri Aug 10 14:44:30 EDT 2007


Hi Max,

Responses inline:

On Fri, 2007-08-10 at 20:14 +0200, Max Rydahl Andersen wrote:
> Hi David,
> 
> Questions:
> 
> Did you look at http://www.icu-project.org/ ? It wasn't in the list of 
> alternatives.

Yup.  Actually, ICU is where much of the I18N functionality in the JDK
had been born out of.  Thus, it provides the lower-level functionality
that is leveraged by JBoss I18N - which has a higher-level
applicability.

> Why would I *ever* want to have localized messages inside my code via 
> annotations ?

You don't have to; it is a feature.  If you don't, however, you will
have to "lookup" your L10N values rather than having them be handed to
you per the current "LocalizationContext".

> Why do I need to use special components in jsf to get i18n?

Again, you don't.  The problem with the standard jsf tags for getting
messages from ResourceBundles is that they are, well, limited to
ResourceBundles.  Seam actually has a nice Component that merges
multiple bundles together (lazily), and exposing them to jsf.  Still,
though - it's based on ResourceBundles.  JBoss I18N abstracts out the
storage of L10N data into Repository interfaces (like one impl that uses
the JCR / JSR-170).  Technically I could write a
"RepositoryResourceBundle" - but it wouldn't scale well.  The problem
with ResourceBundle is that it wants to cache things.  There is more
control in JDK 1.6 in this regard, and I will probably leverage it, but
it does add a dependency to 1.6 (while the rest of everything only
requires 1.5).  Okay, enough rambling...

> Why another log framework ?

I know, I know, I know.  Everyone and their brother has at one time or
another written a log abstraction framework.  Some of them do some
pretty cool stuff - Seam's in particular (it handles Component
interpolation).  The problem is that to log I18N messages, one would
have to look up the bundle, get out a string, then log it.  With JBoss
I18N Log, it is one step - just pass in the "code" of the I18N object to
the log statement (as well as any vararg parameters).  Now, Mazz has a
SourceForge project that can do this, as does JBoss Transactions - so I
took the best from both and added it to JBoss I18N.  Again, I'm trying
to unify everyone's efforts here into something not tied to any one
particular project.

> Can I use it/integrate within eclipse plugins ?

The core JBoss I18N library has no dependencies whatsoever on a
"container" like an appserver.  So yes, you can use it in standalone
applications and eclipse plugins (although I haven't tried it via an
eclipse plugin yet).

> /max
> ...




More information about the jboss-development mailing list