Java Reference
In-Depth Information
Tim Says. . .
Localized Text Storage—Isn't That a Pain?
Stripes makes it relatively easy (or at least, I hope less painful) to
localize an application and support more than one language.
But one area we know is a little weak is supporting different
structures for storing all your localized text. Freddy showed an
inventive solution—breaking up the resource bundle using a
decorator—but it did feel a bit like a hack.
Wouldn't it be nice to be able to store your localized text in
a database or in a set of files structured how you choose?
Although Stripes 1.5 relies on two ResourceBundle s for the entire
application, we are looking to change things around for the
next version. At that time we hope to “hide” the entire process
of finding localized text behind a pluggable component so that
other strategies can be plugged in with minimal effort—just like
in other parts of Stripes. Most likely such a component will be
given access to the action bean, the current locale, and one
or more keys in order to provide the localized text.
Until that time, if you want to store localized text in a different
way than Stripes wants it, you have two options. The first is to do
something like Freddy did and implement your own Resource-
Bundle to look for text in different places. The second option is
to store the text however you like and use your build system
to pull it all together into the two resource bundles that Stripes
wants.
 
 
Search WWH ::




Custom Search