You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christoph Jaeger <ch...@derwald.at> on 2007/08/28 23:12:39 UTC

[T5] Localization

Hi,

is there a way to use messages with parameters directly from a HTML
template?

Something like:

<p>${message:results,prop:numberOfDatasets}</p>

with

Page.java

...
public int getNumberOfDatasets()
{
  return numberOfDatasets;
}
...

Page_en.properties:

results:	Found %d datasets.

Page_de.properties:

results:	%d Datensätze gefunden.

If not, does this seem difficult to implement?

Thanks,

Best Regards,

Christoph Jäger

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: [T5] Localization

Posted by Doug Hauge <do...@lithium.com>.
Passing parameters into the message formatter directly from HTML seems more natural than having to inject a 'Messages' interface into the page and add an accessor method for the message any time the number of format parameters is not 0.

Doug

> -----Original Message-----
> From: Massimo Lusetti [mailto:mlusetti@gmail.com]
> Sent: Tuesday, August 28, 2007 2:32 PM
> To: Tapestry users
> Subject: Re: [T5] Localization
> 
> On 8/28/07, Christoph Jaeger <ch...@derwald.at> wrote:
> 
> > If not, does this seem difficult to implement?
> 
> Using normal ResourceBundle features? And doing that inside javacode
> where logic belongs?
> 
> --
> Massimo
> http://meridio.blogspot.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>> -----Original Message-----
>> From: Christoph Jaeger [mailto:christoph.jaeger@derwald.at]
>> Sent: Tuesday, August 28, 2007 2:13 PM
>> To: users@tapestry.apache.org
>> Subject: [T5] Localization
>> 
>> Hi,
>> 
>> is there a way to use messages with parameters directly from a HTML
>> template?
>> 
>> Something like:
>> 
>> <p>${message:results,prop:numberOfDatasets}</p>
>> 
>> with
>> 
>> Page.java
>> 
>> ...
>> public int getNumberOfDatasets()
>> {
>>   return numberOfDatasets;
>> }
>> ...
>> 
>> Page_en.properties:
>> 
>> results:	Found %d datasets.
>> 
>> Page_de.properties:
>> 
>> results:	%d Datensätze gefunden.
>> 
>> If not, does this seem difficult to implement?
>> 
>> Thanks,
>> 
>> Best Regards,
>> 
>> Christoph Jäger
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T5] Localization

Posted by Massimo Lusetti <ml...@gmail.com>.
On 8/28/07, Christoph Jaeger <ch...@derwald.at> wrote:

> If not, does this seem difficult to implement?

Using normal ResourceBundle features? And doing that inside javacode
where logic belongs?

-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org