You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ford prefect <fo...@yahoo.de> on 2003/11/29 21:17:48 UTC

50 dollars reward

Hello everyone!

As there were no replies, I will offer a reward of 50
dollar/euros or an answer, paid via PayPal.

If someone could anser my question, it would be really
nice and it would help me a lot on my understanding of
tapestry.
Let`s reverse engineer from the html output to
tapestry.
Imagine I want to have the following output for a
webpage, one in English, one in German.

<HTML>
<HEAD>
<TITLE>english title</TITLE>
<META NAME="Description" CONTENT="english content">
</HEAD>
<BODY>
<table>
<tr>
<td>
<table>
<tr><td>Heading</td></tr>
<tr><td>my content</td></tr>
</table>
</td> 

<td>
</td>
</tr>
</table>
</BODY>
</HTML>
-------------------------------------------------------
<HTML>
<HEAD>
<TITLE>deutscher titel</TITLE>
<META NAME="Description" CONTENT="deutscher inhalt">
</HEAD>
<BODY>
<table>
<tr>
<td>
<table>
<tr><td>&Uuml;berschrift</td></tr>
<tr><td>mein Inhalt</td></tr>
</table>
</td> 

<td>
</td>
</tr>
</table>
</BODY>
</HTML>
___________________________________________________
The Tapestry page should look like follows (?)

<HTML>
<span jwcid="header" title="_WELCOME_TITEL"
language="?HTTP_USER_AGENT[language]?"/>
<BODY>
<span jwcid="mainframe">
<span jwcid="sidebox" heading="_HEADING_OVERVIEW">
_DEMO_TEXT
</span>
</span>
</BODY>
</HTML>
_____________________________________________________

1. Would that be the right direction of using Tapestry
and if not how would it look like? Just forget all the
java and xml stuff for a while and just regard the
html template.

2. how would the components look like in the jwc
files? do i need a jwc file for something without
parameters?
do i need classes for those jwc components? what would
they look like?

3. how do i tell the template to use the browser
language from the HTTP_USER_AGENT variables? How would
I pass it to the component?

4. where would I specifiy the constants for both
languages?

5. or how would you do it?
Could we maybe discuss this and also add it to the
tutorial as an example?

Thank you very much!

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de

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


Re: 50 dollars reward

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Saturday, November 29, 2003, at 03:17  PM, ford prefect wrote:
> As there were no replies, I will offer a reward of 50
> dollar/euros or an answer, paid via PayPal.

I don't want your money, and my answer is probably only going to give 
you pointers to your own solution, but here goes....

> The Tapestry page should look like follows (?)
>
> <HTML>
> <span jwcid="header" title="_WELCOME_TITEL"
> language="?HTTP_USER_AGENT[language]?"/>
> <BODY>
> <span jwcid="mainframe">
> <span jwcid="sidebox" heading="_HEADING_OVERVIEW">
> _DEMO_TEXT
> </span>
> </span>
> </BODY>
> </HTML>
> _____________________________________________________
>
> 1. Would that be the right direction of using Tapestry
> and if not how would it look like? Just forget all the
> java and xml stuff for a while and just regard the
> html template.

For your simplistic example where all you want is text replacement 
between languages, just use <span key="title"/>, etc.  Then use 
localized resource bundles for each language.  The workbench shows an 
example of this.

If the differences is actual structural differences in the templates 
themselves, then you can have a different template for each language 
using the same naming conventions that you use for localized resource 
bundles (with the locale as a suffix - *_de.html, for example).

> 2. how would the components look like in the jwc
> files? do i need a jwc file for something without
> parameters?
> do i need classes for those jwc components? what would
> they look like?

Components would be the same regardless of language.  The resource 
bundles would vary if they have text associated with them.

> 3. how do i tell the template to use the browser
> language from the HTTP_USER_AGENT variables? How would
> I pass it to the component?

I believe this is the default behavior and you would not have to do 
anything manually to have the browser requested locale picked up.  I'm 
not currently looking at the code, but this how I believe it works 
(correct me if I'm wrong).

Components pick up the locale just like pages do.  No worries there.

> 4. where would I specifiy the constants for both
> languages?

No need to if you just want the language selected from the browser 
request.

Again, look at how the L10N tab works in the workbench for an example 
(although its a programatic example there, but would not have to be).

> 5. or how would you do it?
> Could we maybe discuss this and also add it to the
> tutorial as an example?

Once again, look at the workbench example and if that is insufficient 
then feel free to modify it to be more along the lines of what you want 
to see and submit it back to us.

I would do it as I have stated here - simply use locale-specific 
resource bundles per page or component and let Tapestry's automatic 
handling of browser request locale do the work.

	Erik


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


Re: 50 dollars reward

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Saturday, November 29, 2003, at 03:17  PM, ford prefect wrote:
> As there were no replies, I will offer a reward of 50
> dollar/euros or an answer, paid via PayPal.

I don't want your money, and my answer is probably only going to give 
you pointers to your own solution, but here goes....

> The Tapestry page should look like follows (?)
>
> <HTML>
> <span jwcid="header" title="_WELCOME_TITEL"
> language="?HTTP_USER_AGENT[language]?"/>
> <BODY>
> <span jwcid="mainframe">
> <span jwcid="sidebox" heading="_HEADING_OVERVIEW">
> _DEMO_TEXT
> </span>
> </span>
> </BODY>
> </HTML>
> _____________________________________________________
>
> 1. Would that be the right direction of using Tapestry
> and if not how would it look like? Just forget all the
> java and xml stuff for a while and just regard the
> html template.

For your simplistic example where all you want is text replacement 
between languages

>
> 2. how would the components look like in the jwc
> files? do i need a jwc file for something without
> parameters?
> do i need classes for those jwc components? what would
> they look like?
>
> 3. how do i tell the template to use the browser
> language from the HTTP_USER_AGENT variables? How would
> I pass it to the component?
>
> 4. where would I specifiy the constants for both
> languages?
>
> 5. or how would you do it?
> Could we maybe discuss this and also add it to the
> tutorial as an example?
>
> Thank you very much!
>
> __________________________________________________________________
>
> Gesendet von Yahoo! Mail - http://mail.yahoo.de
> Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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