You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joshua Jackson <jo...@gmail.com> on 2007/10/25 05:49:57 UTC

T4: Change locale from Page

Dear all,

Is it possible to change locale from the page instead of from the
browser using T4?

Thanks in advance

-- 
What you want today, may not exist tommorrow

Blog: http://joshuajava.wordpress.com/

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


Re: T4: Change locale from Page

Posted by Joshua Jackson <jo...@gmail.com>.
Thanks very much Alejandro. I will go and try it.

Thanks very much :)

On 10/25/07, Alejandro Scandroli <al...@gmail.com> wrote:
> Hi Joshua
>
> You can do something like this:
>
>        public void click(IRequestCycle cycle)
>        {
>                Locale locale = [YOUR LOCALE HERE]
>                getPage().getEngine().setLocale(locale);
> // pages already loaded stay in the old locale, so  to show that the
> locale has changed the page needs to be reloaded
>                cycle.cleanup();
>                throw new PageRedirectException(getPage());
>        }
>
> I hope it helps.
> Alejandro.
>
> On 10/25/07, Joshua Jackson <jo...@gmail.com> wrote:
> > Dear all,
> >
> > Is it possible to change locale from the page instead of from the
> > browser using T4?
> >
> > Thanks in advance
> >
> > --
> > What you want today, may not exist tommorrow
> >
> > Blog: http://joshuajava.wordpress.com/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
What you want today, may not exist tommorrow

Blog: http://joshuajava.wordpress.com/

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


Re: T4: Change locale from Page

Posted by Alejandro Scandroli <al...@gmail.com>.
Hi Joshua

You can do something like this:

	public void click(IRequestCycle cycle)
	{
		Locale locale = [YOUR LOCALE HERE]
		getPage().getEngine().setLocale(locale);
// pages already loaded stay in the old locale, so  to show that the
locale has changed the page needs to be reloaded
		cycle.cleanup();
		throw new PageRedirectException(getPage());
	}

I hope it helps.
Alejandro.

On 10/25/07, Joshua Jackson <jo...@gmail.com> wrote:
> Dear all,
>
> Is it possible to change locale from the page instead of from the
> browser using T4?
>
> Thanks in advance
>
> --
> What you want today, may not exist tommorrow
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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