You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by wesleywj2 <we...@yahoo.co.uk> on 2011/11/17 21:02:05 UTC

T5.1 locale switch back to default english after navigate to other page

hi there,

i successfully switch the locale between english and chinese "zh_CN" within
a page, but encountered a problem where once i switch to chinese and
navigate to other pages with actionlink,submit etc, the other page switched
back to default english. how do i keep the locale persisted for all pages
after locale switching?

please advice,
wesleywj2

--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-1-locale-switch-back-to-default-english-after-navigate-to-other-page-tp5002303p5002303.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: T5.1 locale switch back to default english after navigate to other page

Posted by wesleywj2 <we...@yahoo.co.uk>.
hi,

my page is using border, where i wrote

@Inject private PersistentLocale peLocale;

@OnEvent(component="switchlocale")
	void changeLocale(){
		if(currentLocale.equals(Locale.CHINESE)){
			peLocale.set(Locale.ENGLISH);
		}else{
			peLocale.set(Locale.CHINESE);
		}
	}

i did use PersistentLocale to switch the locale, but it still changed back
to english after navigate to other page. please advice


--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-1-locale-switch-back-to-default-english-after-navigate-to-other-page-tp5002303p5003295.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: T5.1 locale switch back to default english after navigate to other page

Posted by dh ning <ni...@gmail.com>.
Hi,

If you switch locale by PersistentLocale service, I think the locale will
be persisted.

Thanks,
DH

2011/11/18 wesleywj2 <we...@yahoo.co.uk>

> hi there,
>
> i successfully switch the locale between english and chinese "zh_CN" within
> a page, but encountered a problem where once i switch to chinese and
> navigate to other pages with actionlink,submit etc, the other page switched
> back to default english. how do i keep the locale persisted for all pages
> after locale switching?
>
> please advice,
> wesleywj2
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/T5-1-locale-switch-back-to-default-english-after-navigate-to-other-page-tp5002303p5002303.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>