Reputation: 3018
I have creating login page in that, I am taking user's prefered language from drop down list. After successful login, selected locale will be used rather than Browser's locale
For aformentioned scenario, I am tring below code
Locale.Builder langBuider = new Locale.Builder();
langBuider.setLanguageTag( getSelectedLocale() );
getEngine().setLocale( langBuider.build() );
Even after this locale is not getting updated. I found that to make it effective from same request, I have to change recreate page with updated locale
IRequestCycle requestCycle = getRequestCycle();
requestCycle.cleanup();
requestCycle.activate( "Home" );
but after adding this code Tapestry throws exception
Upvotes: 0
Views: 95
Reputation:
I was also facing similar problem. I have done little modification
IPage page = requestCycle.getPage( "pageName");
requestCycle.activate( page );
This works for me
Upvotes: 1