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]