> -----Original Message-----
> From: ext Jon Stevens [mailto:[EMAIL PROTECTED]]
> Sent: 02. June 2001 20:50
> To: turbine-dev
> Subject: Re: PullModel for localization??
>
>
> on 6/2/01 10:26 AM, "Jason van Zyl" <[EMAIL PROTECTED]> wrote:
>
> > Ok, I see that you can use Properties files too, but I
> think there are
> > problems with that too vis-a-vis encoding.
>
> I don't see why a .properties would be any different than an
> XML file with
> regards to this.
XML files can contain a standardized header specifying the encoding used in
the contents of the file. The header itself is always US_ASCII and can be
read and interpreted before continuing with the rest of the file. The code
required for checking the encoding is not especially beautiful, but as it's
standardized for any XML file, it can be done with the one same piece of
ugly code. Property files support only latin-1 and unicode escaped
characters, which are a pain for other than latin-1 based properties.
> > This is dealt with now I
> > believe
> > in the ExtendedProperties class in the commons thank to
> Geir and Ilkka.
>
> Kewl. My only point for using RB's is that this is the "Java"
> way � to do
> things.
The "Java" way is based on jdk 1.1, the world has evolved since that :)
> > I assumed the requirement of java classes because this is what is
> > present
> > in Jyve and Jetspeed.
>
> Jyve used .java because the documentation for RB's doesn't
> say you can use
> .properties. It only says you can use .java. Later, I found out that
> .properties files are acceptable as well.
>
> Jetspeed just copied Jyve without realizing it either.
>
> > It's a replacement. Craig had this to say about it on the
> commons list:
> >
> > One meta-issue that I ran into with Struts (and the reason that I'm
> > not
> > using ResourceBundle underneath) is that some app servers want your
> > servlet context attributes (as well as your session
> attributes) to be
> > Serializable. This probably won't affect Turbine (which, I gather,
> > prefers singletons using global statics for stuff like
> this), but will
> > affect others who want to store message resources in the servlet
> > context.
> >
> > What he says is true for now in the way we do localization,
> but maybe
> > in the future for some turbine application that uses heavy
> customization
> > a set of Resources may be stored in the session.
>
> I think it is a terribly bad design to store Resources in the
> session. The
> reason is that if you ever want to abstract out the Session's
> data onto a
> "Distributed Session Server", then having a bunch of string
> data in your
> Session is a colossal waste of memory and resources.
>
> > And there are the encoding issues too with properties files
> which make
> > them bad for any real localization requirements as Ilkka
> has remarked
> > on.
>
> I think I remember this, but I don't remember the issues...I
> would suspect
> that RB's and properties files would actually work with
> localization since
> that is what they were intended for. :-)
Once again, the issue is that property files support only latin-1 and
unicode escaped (\uXXXX) characters and require thus a native program with
which to convert your primary localized properties to u-escaped properties
before they can be used in resource bundles. This extra phase means that if
an alternative is available supporting direct use of your localized
properties, no-one uses the more complicated way. It means also that if
Turbine doesn't provide this direct access mechanism, all localized apps
using Turbine will develop their own way of doing it.
> > The localization service work perfectly, I would just rather use the
> > Resources
> > classes that will be developed in the commons rather than
> > ResourceBundles.
+1
> Fine by me. I'm not arguing with you...I'm just pointing out
> that RB's can
> be used with . properties files.
> > I think there will be a nice cross-pollenation of the
> Velocity resources
> > work
> > and the MessageResources work in Struts. I think this will
> make a very
> > powerful
> > set or resource classes that would be ideal for
> localization. With the
> > work
> > that has been done in Velocity and Struts we could, in very
> short order,
> > be
> > able to pull localized resources from file, XML, LDAP, and DB
> > repositories.
>
> +1
++1
-- Ilkka
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]