You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ryan McKinley <ry...@gmail.com> on 2009/04/30 22:22:22 UTC

Share Localization across many pages/componets

I'm finally getting around to localizing my application -- the wicket  
tools for this are awesome, thank you!

Everything works great when I follow the standard pattern:
  page.html
  page.properties
  page_es.properties

This is all fine and good, but in practice, I have many strings that  
are duplicated across many pages/components and don't want to maintain  
duplicate translations etc.

How do people generally solve this problem?  I don't see any  
references on the wiki/web -- perhaps a custom ResourceStreamLocator?   
Is there a standard way to consolidate all my localization rather then  
sprinkled within my source tree?

Thanks for any pointers

Ryan

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


Re: Share Localization across many pages/componets

Posted by Martijn Dashorst <ma...@gmail.com>.
and use <wicket:message> in your pages... but it seems you already
found this one :)

Martijn

On Fri, May 1, 2009 at 4:45 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> Typically you should avoid this raw data push / pull and instead use a
> ResourceModel.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Fri, May 1, 2009 at 3:22 AM, Mathias Nilsson
> <wi...@gmail.com> wrote:
>>
>> You could do this in your base class if you use markup inheritence
>>
>> public String getResource( String resource ){
>>  return Application.get().getResourceSettings().getLocalizer().getString(
>> resource, null, "");
>> }
>> --
>> View this message in context: http://www.nabble.com/Share-Localization-across-many-pages-componets-tp23323748p23329846.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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


Re: Share Localization across many pages/componets

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Typically you should avoid this raw data push / pull and instead use a
ResourceModel.

--
Jeremy Thomerson
http://www.wickettraining.com




On Fri, May 1, 2009 at 3:22 AM, Mathias Nilsson
<wi...@gmail.com> wrote:
>
> You could do this in your base class if you use markup inheritence
>
> public String getResource( String resource ){
>  return Application.get().getResourceSettings().getLocalizer().getString(
> resource, null, "");
> }
> --
> View this message in context: http://www.nabble.com/Share-Localization-across-many-pages-componets-tp23323748p23329846.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Share Localization across many pages/componets

Posted by Mathias Nilsson <wi...@gmail.com>.
You could do this in your base class if you use markup inheritence

public String getResource( String resource ){
  return Application.get().getResourceSettings().getLocalizer().getString(
resource, null, ""); 
}
-- 
View this message in context: http://www.nabble.com/Share-Localization-across-many-pages-componets-tp23323748p23329846.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Share Localization across many pages/componets

Posted by Ryan McKinley <ry...@gmail.com>.
aaah, that makes sense...


On Apr 30, 2009, at 4:29 PM, Jeremy Thomerson wrote:

> put it all in MyApp.properties or MyBasePage.properties.  There's a
> very good section on this in WiA book, and I know that someone also
> did a good blog post about it around a year ago.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
>
> On Thu, Apr 30, 2009 at 3:22 PM, Ryan McKinley <ry...@gmail.com>  
> wrote:
>> I'm finally getting around to localizing my application -- the  
>> wicket tools
>> for this are awesome, thank you!
>>
>> Everything works great when I follow the standard pattern:
>>  page.html
>>  page.properties
>>  page_es.properties
>>
>> This is all fine and good, but in practice, I have many strings  
>> that are
>> duplicated across many pages/components and don't want to maintain  
>> duplicate
>> translations etc.
>>
>> How do people generally solve this problem?  I don't see any  
>> references on
>> the wiki/web -- perhaps a custom ResourceStreamLocator?  Is there a  
>> standard
>> way to consolidate all my localization rather then sprinkled within  
>> my
>> source tree?
>>
>> Thanks for any pointers
>>
>> Ryan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


Re: Share Localization across many pages/componets

Posted by Jeremy Thomerson <je...@wickettraining.com>.
put it all in MyApp.properties or MyBasePage.properties.  There's a
very good section on this in WiA book, and I know that someone also
did a good blog post about it around a year ago.

--
Jeremy Thomerson
http://www.wickettraining.com




On Thu, Apr 30, 2009 at 3:22 PM, Ryan McKinley <ry...@gmail.com> wrote:
> I'm finally getting around to localizing my application -- the wicket tools
> for this are awesome, thank you!
>
> Everything works great when I follow the standard pattern:
>  page.html
>  page.properties
>  page_es.properties
>
> This is all fine and good, but in practice, I have many strings that are
> duplicated across many pages/components and don't want to maintain duplicate
> translations etc.
>
> How do people generally solve this problem?  I don't see any references on
> the wiki/web -- perhaps a custom ResourceStreamLocator?  Is there a standard
> way to consolidate all my localization rather then sprinkled within my
> source tree?
>
> Thanks for any pointers
>
> Ryan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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