You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ra <ry...@gazeta.pl> on 2007/08/11 22:45:02 UTC

t5 how to load messages

how to load messages for the specific page in a component ?
I've a kind of border component used by many pages and would like get for
example page-label value which is defined for each page in its bundle
-- 
View this message in context: http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12108897
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5 how to load messages

Posted by "Nick Westgate (Work)" <ni...@key-planning.co.jp>.
BTW, the page Shing referred you to covers the use-case you gave.
Look for the code passing a message to the border component:
<t:layout title="message:page-title">.

(I realise you probably want to do more of the work from the layout though.)

Cheers,
Nick.



ra wrote:
> 
> Yes, of course, but that case is not described and I don't know t5
> internals
> I think I've to inject kind of message provider to get message bundle by
> page name
> 
> 
> 
> Shing Hing Man wrote:
>> 
>> Have you checked out 
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
>> ? 
>> Shing
>> 
>> --- ra <ry...@gazeta.pl> wrote:
>> 
>>> 
>>> how to load messages for the specific page in a
>>> component ?
>>> I've a kind of border component used by many pages
>>> and would like get for
>>> example page-label value which is defined for each
>>> page in its bundle
>>> -- 
>>> View this message in context:
>>>
>> http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12108897
>>> Sent from the Tapestry - User mailing list archive
>>> at Nabble.com.
>>> 
>>> 
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>>> users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail:
>>> users-help@tapestry.apache.org
>>> 
>>> 
>> 
>> 
>> Home page : http://www.lombok.demon.co.uk/
>> 
>> 
>> 
>>       ___________________________________________________________
>> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
>> it
>> now.
>> http://uk.answers.yahoo.com/ 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12110628
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5 how to load messages

Posted by ra <ry...@gazeta.pl>.
Thanks a lot, I was exactly looking for it but for some reason I igonored
that annotation

PS I hoped  the order was as you wrote but I had to use
resources.getContainerMessages() instead


Shing Hing Man wrote:
> 
> Have you tried the following ?
> 
>    @Inject
> 	private ComponentResources resources;
> 	resources.getMessages().get("keyInPropertiesFile")
> 
> I think Tapestry search the .properties file in the 
> following order.
> 1) the component .properties
> 2) The page, which contains the component,
> .properties.
> 3) The application .properties.
> 
> Shing 
> 
> 
> --- ra <ry...@gazeta.pl> wrote:
> 
>> 
>> Yes, of course, but that case is not described and I
>> don't know t5 internals
>> I think I've to inject kind of message provider to
>> get message bundle by
>> page name
>> 
>> 
>> 
>> Shing Hing Man wrote:
>> > 
>> > Have you checked out 
>> >
>>
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
>> > ? 
>> > Shing
>> > 
>> > --- ra <ry...@gazeta.pl> wrote:
>> > 
>> >> 
>> >> how to load messages for the specific page in a
>> >> component ?
>> >> I've a kind of border component used by many
>> pages
>> >> and would like get for
>> >> example page-label value which is defined for
>> each
>> >> page in its bundle
>> >> -- 
>> >> View this message in context:
>> >>
>> >
>>
> http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12108897
>> >> Sent from the Tapestry - User mailing list
>> archive
>> >> at Nabble.com.
>> >> 
>> >> 
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> >> users-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail:
>> >> users-help@tapestry.apache.org
>> >> 
>> >> 
>> > 
>> > 
>> > Home page : http://www.lombok.demon.co.uk/
>> > 
>> > 
>> > 
>> >      
>>
> ___________________________________________________________
>> > Yahoo! Answers - Got a question? Someone out there
>> knows the answer. Try
>> > it
>> > now.
>> > http://uk.answers.yahoo.com/ 
>> > 
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail:
>> users-help@tapestry.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12109529
>> Sent from the Tapestry - User mailing list archive
>> at Nabble.com.
>> 
>> 
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>> 
>> 
> 
> 
> Home page : http://www.lombok.demon.co.uk/
> 
> 
> 
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/ 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12112450
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5 how to load messages

Posted by Shing Hing Man <ma...@yahoo.com>.
Have you tried the following ?

   @Inject
	private ComponentResources resources;
	resources.getMessages().get("keyInPropertiesFile")

I think Tapestry search the .properties file in the 
following order.
1) the component .properties
2) The page, which contains the component,
.properties.
3) The application .properties.

Shing 


--- ra <ry...@gazeta.pl> wrote:

> 
> Yes, of course, but that case is not described and I
> don't know t5 internals
> I think I've to inject kind of message provider to
> get message bundle by
> page name
> 
> 
> 
> Shing Hing Man wrote:
> > 
> > Have you checked out 
> >
>
http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
> > ? 
> > Shing
> > 
> > --- ra <ry...@gazeta.pl> wrote:
> > 
> >> 
> >> how to load messages for the specific page in a
> >> component ?
> >> I've a kind of border component used by many
> pages
> >> and would like get for
> >> example page-label value which is defined for
> each
> >> page in its bundle
> >> -- 
> >> View this message in context:
> >>
> >
>
http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12108897
> >> Sent from the Tapestry - User mailing list
> archive
> >> at Nabble.com.
> >> 
> >> 
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail:
> >> users-help@tapestry.apache.org
> >> 
> >> 
> > 
> > 
> > Home page : http://www.lombok.demon.co.uk/
> > 
> > 
> > 
> >      
>
___________________________________________________________
> > Yahoo! Answers - Got a question? Someone out there
> knows the answer. Try
> > it
> > now.
> > http://uk.answers.yahoo.com/ 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail:
> users-help@tapestry.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
>
http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12109529
> Sent from the Tapestry - User mailing list archive
> at Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
> 
> 


Home page : http://www.lombok.demon.co.uk/



      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

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


Re: t5 how to load messages

Posted by ra <ry...@gazeta.pl>.
Yes, of course, but that case is not described and I don't know t5 internals
I think I've to inject kind of message provider to get message bundle by
page name



Shing Hing Man wrote:
> 
> Have you checked out 
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
> ? 
> Shing
> 
> --- ra <ry...@gazeta.pl> wrote:
> 
>> 
>> how to load messages for the specific page in a
>> component ?
>> I've a kind of border component used by many pages
>> and would like get for
>> example page-label value which is defined for each
>> page in its bundle
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12108897
>> Sent from the Tapestry - User mailing list archive
>> at Nabble.com.
>> 
>> 
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>> 
>> 
> 
> 
> Home page : http://www.lombok.demon.co.uk/
> 
> 
> 
>       ___________________________________________________________
> Yahoo! Answers - Got a question? Someone out there knows the answer. Try
> it
> now.
> http://uk.answers.yahoo.com/ 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12109529
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5 how to load messages

Posted by Shing Hing Man <ma...@yahoo.com>.
Have you checked out 
http://tapestry.apache.org/tapestry5/tapestry-core/guide/localization.html
? 
Shing

--- ra <ry...@gazeta.pl> wrote:

> 
> how to load messages for the specific page in a
> component ?
> I've a kind of border component used by many pages
> and would like get for
> example page-label value which is defined for each
> page in its bundle
> -- 
> View this message in context:
>
http://www.nabble.com/t5-how-to-load-messages-tf4254673.html#a12108897
> Sent from the Tapestry - User mailing list archive
> at Nabble.com.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
> 
> 


Home page : http://www.lombok.demon.co.uk/



      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

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