You don't need to have dofferent directories for the templates all you need to
have is to Localize each string you use in your vm's
and put in the context the correct ResourceBundle.
Take a look at www.discuss.gr choose english language of course.
There is only one vm but each time you change your language a different
ResourceBundle
is been put in the context so correct representation of the string is shown
Also look at LocalizationService of Turbine.
When you want to add a new lanuguage you just Translate all
your strings in a new ResourceBundle and you are ready.
Colin Chalmers wrote:
> Hi all,
>
> I don't really recall a conclusion to this discussion so I'm going to break
> it open again. I too have to build a site for multiple languages (Dutch &
> English). My approach was to have two sets of templates with the same names
> under English & Dutch directories; this way the designers can change the
> layout without touching business logic and I have room to add extra
> languages (French & German are already on the cards).
>
> I want to base the choice of template on the display language that the user
> has chosen for his browser. It's not a problem to get that setting
> but.....this is the question....when can/should this take place in order for
> Velocity to know which path to the correct template???
>
> I take it it should be the first template/screen that get's hit ?? Or do I
> have to have a layout class (I presently use a default.vm with no
> corresponding java class) and if so where do I have this so that it can be
> found similiar to screens & Actions. modules/layout ??
>
> Any help appreciated.
>
> Thanx
>
> /Colin
>
> >
> >
> > > Hi
> > >
> > > String lang = (String) session.getAttribute("UserLanguage");
> > > Properties props = (Properties)
> > session.getAttribute("LangaugeProperties");
> > >
> > > String title = props.getProperty(lang + "_TITLE");
> > >
> > Its ok to use it as a quick hack, but Properties shouldn't be
> > used if
> > optimal performance is required.
> > The problem is that props.getProperty is threadsafe (Properties
> > extends
> > hashtable), so imagine if we have 20 threads concurrently
> > rendering the same
> > page, and all of them need to access the same Properties object
> > multiple
> > times in one pass. Thats a lot of waiting.
> >
> > - Kasper
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
begin:vcard
n:Skondras;Panagiotis
tel;cell:0932707562
tel;work:6872953
x-mozilla-html:FALSE
url:http://users.aias.gr/pskon
org:ACN SA;Developer
adr:;;;Athens;ATTIKI;;Greece
version:2.1
email;internet:[EMAIL PROTECTED]
title:Software Developer
note:ICQ =117160052
end:vcard
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]