You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Wellman <dw...@uswest.net> on 2002/03/07 01:24:44 UTC
iI8n and templates
I have a quick question.
does anyone know how to deal with localized templates?
I need to use a template based on a local
IE:
<template:insert template="/templates/i18n/us_en/headerTemplate.jsp">
<template:put name="title" content="Welcome" direct="true"/>
</template:insert>
<template:insert template="/pages/i18n/en_us/about.jsp/>
<template:insert template="/templates/i18n/us_en/footerTemplate.jsp"/>
but I don't really know what page to use until runtime. So I would like to
do something like:
<template:insert template="<bean:message key="header.template"/>">
<template:put name="title" content="<bean:message
key="header.welcome"/>" direct="true"/>
</template:insert>
<template:insert template="<bean:write name="page"\>">
<template:insert template="<bean:message key="footer.template"/>"/>
suggestions?
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: iI8n and templates
Posted by Cedric Dumoulin <ce...@lifl.fr>.
Hello,
Check Tiles (extended templates). There is a i18n templating support.
Basically, you use a logical name (a definition name) as template target.
Definition can be described in an xml file, and you can have different
description for each locale (one file for each locale). Choice of appropriate
definition follow the same rules as java properties.
Cedric
Dave Wellman wrote:
> I have a quick question.
>
> does anyone know how to deal with localized templates?
>
> I need to use a template based on a local
>
> IE:
>
> <template:insert template="/templates/i18n/us_en/headerTemplate.jsp">
> <template:put name="title" content="Welcome" direct="true"/>
> </template:insert>
>
> <template:insert template="/pages/i18n/en_us/about.jsp/>
>
> <template:insert template="/templates/i18n/us_en/footerTemplate.jsp"/>
>
> but I don't really know what page to use until runtime. So I would like to
> do something like:
>
> <template:insert template="<bean:message key="header.template"/>">
> <template:put name="title" content="<bean:message
> key="header.welcome"/>" direct="true"/>
> </template:insert>
>
> <template:insert template="<bean:write name="page"\>">
>
> <template:insert template="<bean:message key="footer.template"/>"/>
>
> suggestions?
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>