You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Martin Poeschl <mp...@marmot.at> on 2001/06/02 00:57:39 UTC

PullModel for localization??

would it make sense to use the PullModel for localization?? (instead of
ResourceBundles??)

if i set scope to session, each user could select his language. right?






---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: PullModel for localization??

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/2/01 10:26 AM, "Jason van Zyl" <jv...@apache.org> 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.

> 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.

> 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. :-)

> The localization service work perfectly, I would just rather use the
> Resources
> classes that will be developed in the commons rather than
> ResourceBundles.

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

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Balmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: PullModel for localization??

Posted by Jason van Zyl <jv...@apache.org>.
Jon Stevens wrote:
> 
> on 6/2/01 9:20 AM, "Jason van Zyl" <jv...@apache.org> wrote:
> 
> > Jon Stevens wrote:
> >>
> >> on 6/1/01 3:57 PM, "Martin Poeschl" <mp...@marmot.at> wrote:
> >>
> >>> would it make sense to use the PullModel for localization?? (instead of
> >>> ResourceBundles??)
> >>
> >> The LocalizationService is already 99% of the way there. Just make it
> >> available in the context through a small PullTool wrapper and you are set.
> >
> > It looks like like you have to use ResourceBundles which forces you to
> > place
> > your localized messages in java sources files? Is this the case? If so
> > then
> > IMO the localization services needs some work.
> 
> Nope. That isn't the case.

Ok, I see that you can use Properties files too, but I think there are
problems with that too vis-a-vis encoding. This is dealt with now I
believe
in the ExtendedProperties class in the commons thank to Geir and Ilkka.
I assumed the requirement of java classes because this is what is
present
in Jyve and Jetspeed.

> 
> > I asked Craig to put the Struts MessageResources classes into the
> > commons
> > because I think that approach is better: one in which localized messages
> > can be taken from any source. This would allow, for example, localized
> > messages to be stored in XML files and these XML files could have a
> > known
> > DTD which would allow a non-programmer to work with a tool like XML Spy
> > to correctly produce a set of localized message resources.
> 
> Sounds just like another layer on top of ResourceBundles. Not a bad idea.

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.

And there are the encoding issues too with properties files which make
them bad for any real localization requirements as Ilkka has remarked
on.

The localization service work perfectly, I would just rather use the
Resources
classes that will be developed in the commons rather than
ResourceBundles.

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.

I definitely think it's something worth looking at.

> > I've never used ResourceBundles, but if it is the case that you have to
> > edit a java file and compile it to get localization to work than I don't
> > think that's even close to an ideal solution. Correct me if this is
> > not the case. I asked Craig to put his classes in the commons so that
> > we could eventually use them for the turbine localization service.
> 
> I'm correcting you.
> 
> -jon
> 
> --
> "Open source is not available to commercial companies."
>             -Steve Balmer, CEO Microsoft
> <http://www.suntimes.com/output/tech/cst-fin-micro01.html>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: PullModel for localization??

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/2/01 9:20 AM, "Jason van Zyl" <jv...@apache.org> wrote:

> Jon Stevens wrote:
>> 
>> on 6/1/01 3:57 PM, "Martin Poeschl" <mp...@marmot.at> wrote:
>> 
>>> would it make sense to use the PullModel for localization?? (instead of
>>> ResourceBundles??)
>> 
>> The LocalizationService is already 99% of the way there. Just make it
>> available in the context through a small PullTool wrapper and you are set.
> 
> It looks like like you have to use ResourceBundles which forces you to
> place
> your localized messages in java sources files? Is this the case? If so
> then
> IMO the localization services needs some work.

Nope. That isn't the case.

> I asked Craig to put the Struts MessageResources classes into the
> commons
> because I think that approach is better: one in which localized messages
> can be taken from any source. This would allow, for example, localized
> messages to be stored in XML files and these XML files could have a
> known
> DTD which would allow a non-programmer to work with a tool like XML Spy
> to correctly produce a set of localized message resources.

Sounds just like another layer on top of ResourceBundles. Not a bad idea.

> I've never used ResourceBundles, but if it is the case that you have to
> edit a java file and compile it to get localization to work than I don't
> think that's even close to an ideal solution. Correct me if this is
> not the case. I asked Craig to put his classes in the commons so that
> we could eventually use them for the turbine localization service.

I'm correcting you.

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Balmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: PullModel for localization??

Posted by Jason van Zyl <jv...@apache.org>.
Jon Stevens wrote:
> 
> on 6/1/01 3:57 PM, "Martin Poeschl" <mp...@marmot.at> wrote:
> 
> > would it make sense to use the PullModel for localization?? (instead of
> > ResourceBundles??)
> 
> The LocalizationService is already 99% of the way there. Just make it
> available in the context through a small PullTool wrapper and you are set.

It looks like like you have to use ResourceBundles which forces you to
place
your localized messages in java sources files? Is this the case? If so
then
IMO the localization services needs some work.

I asked Craig to put the Struts MessageResources classes into the
commons
because I think that approach is better: one in which localized messages
can be taken from any source. This would allow, for example, localized
messages to be stored in XML files and these XML files could have a
known
DTD which would allow a non-programmer to work with a tool like XML Spy
to correctly produce a set of localized message resources.

I've never used ResourceBundles, but if it is the case that you have to
edit a java file and compile it to get localization to work than I don't
think that's even close to an ideal solution. Correct me if this is
not the case. I asked Craig to put his classes in the commons so that
we could eventually use them for the turbine localization service.

> 
> > if i set scope to session, each user could select his language. right?
> 
> Yup.
> 
> -jon
> 
> --
> "Open source is not available to commercial companies."
>             -Steve Balmer, CEO Microsoft
> <http://www.suntimes.com/output/tech/cst-fin-micro01.html>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: PullModel for localization??

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/1/01 3:57 PM, "Martin Poeschl" <mp...@marmot.at> wrote:

> would it make sense to use the PullModel for localization?? (instead of
> ResourceBundles??)

The LocalizationService is already 99% of the way there. Just make it
available in the context through a small PullTool wrapper and you are set.

> if i set scope to session, each user could select his language. right?

Yup.

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Balmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org