You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Luis Neves <ln...@netcabo.pt> on 2003/06/30 01:04:09 UTC

Some questions on localization.

Hello all,
I'm having some difficulties in trying  to localize my application using 
*.properties files.
I'm using this syntax:

Home.html
<span class="txtSmall" key="trans1">Placeholder text</span>

Home.properties
trans1=English Text

Home_pt_PT.properties
trans1=Portuguese Text

But the resulting HTML is this:
<span class="txtSmall" key="trans1">[TRANS1]</span>

The *.properties files are in the same directory than the *.html files, and 
strangely enough when using a translated template (Home_pt_PT.html) instead 
of a *.properties the translation works.

I must be doing something wrong because I have a Border component that gets 
properly localized using the *.properties files approach.

Actually not even the Border componet is free of problems. Another issue I'm 
facing is that the text in the enclosed Submit component (the "value" 
attribute) isn't getting localized.
The code:
<input jwcid="@Submit" value="string:button1" class="button1 />
It's getting rendered as:
<input type="submit" value="string:button1" class="button1 />

Any hints that would help me to solve these problems are greatly appreciated.

Best regards,
Luis Neves





Re: Some questions on localization.

Posted by Luis Neves <ln...@netcabo.pt>.
On Monday 30 June 2003 01:50, John Meredith wrote:
> Try "message:key". I made the same mistake a few days ago.

Thanks!! ... that was it.
I must have missed school that day.

Best regards,
Luis Neves


Re: Some questions on localization.

Posted by John Meredith <ps...@t-online.de>.
Try "message:key". I made the same mistake a few days ago.

Best regards,

  John

On Mon, 2003-06-30 at 02:22, Luis Neves wrote:
> According to the documentation:
> 
> String bindings (to localized strings) in HTML templates are now in the format 
> attribute="string:key".
> 
> Well... this isn't working. The template is being rendered as is. There isn't 
> a substitution with the localized text.
> For example:
> <a jwcid="@DirectLink" title="string:k1" ...><span key="k1" /></a>
> 
> Renders as:
> <a href="..." title="string:k1">Localized text</a>
> 
> Is this a bug or the "attribute='string:key'" syntax doesn't work with 
> informal parameters?
> 
> Best regards,
> Luis Neves
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
-- 
John Meredith <ps...@t-online.de>


RE: Some questions on localization.

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
Sorry, the docs are off.  It is now "message:".  This was discussed on the list a ways back.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Luis Neves [mailto:lneves@netcabo.pt] 
> Sent: Sunday, June 29, 2003 8:23 PM
> To: Tapestry users
> Subject: Re: Some questions on localization.
> 
> 
> 
> According to the documentation:
> 
> String bindings (to localized strings) in HTML templates are 
> now in the format 
> attribute="string:key".
> 
> Well... this isn't working. The template is being rendered as 
> is. There isn't 
> a substitution with the localized text.
> For example:
> <a jwcid="@DirectLink" title="string:k1" ...><span key="k1" /></a>
> 
> Renders as:
> <a href="..." title="string:k1">Localized text</a>
> 
> Is this a bug or the "attribute='string:key'" syntax doesn't 
> work with 
> informal parameters?
> 
> Best regards,
> Luis Neves
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


Re: Some questions on localization.

Posted by Luis Neves <ln...@netcabo.pt>.
According to the documentation:

String bindings (to localized strings) in HTML templates are now in the format 
attribute="string:key".

Well... this isn't working. The template is being rendered as is. There isn't 
a substitution with the localized text.
For example:
<a jwcid="@DirectLink" title="string:k1" ...><span key="k1" /></a>

Renders as:
<a href="..." title="string:k1">Localized text</a>

Is this a bug or the "attribute='string:key'" syntax doesn't work with 
informal parameters?

Best regards,
Luis Neves


Re: Some questions on localization.

Posted by Luis Neves <ln...@netcabo.pt>.
Hi,

On Monday 30 June 2003 00:10, Howard M. Lewis Ship wrote:
> The properties files should be with the page specifications, in the WEB-INF
> folder.

Ugh ... I feel dumb.
It's working fine now.

But i stiil have this issue:

> > Another issue I'm
> > facing is that the text in the enclosed Submit component (the "value"
> > attribute) isn't getting localized.
> > The code:
> > <input jwcid="@Submit" value="string:button1" class="button1
> > /> It's getting rendered as: <input type="submit"
> > value="string:button1" class="button1 />
> >
> > Any hints that would help me to solve these problems are
> > greatly appreciated.

Any ideias?

Best regards,
Luis Neves





RE: Some questions on localization.

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
The properties files should be with the page specifications, in the WEB-INF folder.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Luis Neves [mailto:lneves@netcabo.pt] 
> Sent: Sunday, June 29, 2003 7:04 PM
> To: Tapestry users
> Subject: Some questions on localization.
> 
> 
> 
> Hello all,
> I'm having some difficulties in trying  to localize my 
> application using 
> *.properties files.
> I'm using this syntax:
> 
> Home.html
> <span class="txtSmall" key="trans1">Placeholder text</span>
> 
> Home.properties
> trans1=English Text
> 
> Home_pt_PT.properties
> trans1=Portuguese Text
> 
> But the resulting HTML is this:
> <span class="txtSmall" key="trans1">[TRANS1]</span>
> 
> The *.properties files are in the same directory than the 
> *.html files, and 
> strangely enough when using a translated template 
> (Home_pt_PT.html) instead 
> of a *.properties the translation works.
> 
> I must be doing something wrong because I have a Border 
> component that gets 
> properly localized using the *.properties files approach.
> 
> Actually not even the Border componet is free of problems. 
> Another issue I'm 
> facing is that the text in the enclosed Submit component (the "value" 
> attribute) isn't getting localized.
> The code:
> <input jwcid="@Submit" value="string:button1" class="button1 
> /> It's getting rendered as: <input type="submit" 
> value="string:button1" class="button1 />
> 
> Any hints that would help me to solve these problems are 
> greatly appreciated.
> 
> Best regards,
> Luis Neves
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>