You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by John Meredith <ps...@t-online.de> on 2003/09/01 15:35:33 UTC

Re: Localization

Hi Mindaugas,

> Last week I asked a question on how to refresh the web app when the user 
> has chosen another language. It has only been suggested to quickly open a 
> redirect-back page. I made an empty HTML page with a quick redirect:
> 
> <script>
> function goBack()
> {
>     window.location = document.referrer;
> }
> </script>
> <body onLoad="javascript:goBack()">
> 
> It has been argued that it is impossible to change the locale for the 
> Engine during the same request cycle. Can someone elaborate why it isn't 
> possible to do that? Telling the engine to reset it's locale during the 
> request cycle would be nice.

The problem is that the page is pooled with its locale ... meaning that
when you change the locale, you're already working with a page
associated with the previous locale.

It's a pain, but unfortunately unavoidable at present.

> The current workaround isn't nice - I'm not sure if it'll work on every 
> browser. I would appreciate if someone else told me how they did their 
> language switch in their web app.

Another option could be:

<meta http-equiv="refresh" content="1; URL=someurl">

in the <head> of your Shell (if you use it) component. That *should* be
compatible with all browsers.

> Maybe someone has a nicer solution? I thought about printing a redirect in 
> the JSP HTTPServletRequest class, but I didn't know where to do that in my 
> Page code. Where one should access the servlet layer during the response 
> in the page?

  - John

-- 
John Meredith <ps...@t-online.de>


Re: Localization

Posted by Vu Nguyen <vn...@yahoo.com>.
Hi, how do you specify the URL on the "refresh" parameter of the Shell 
component? I don't see the "content" as part of its parameters.




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