Apache Wicket > Framework Documentation > Reference library > How to do things in Wicket > i18n > Manually switching locale
Added by Will Hoover, last edited by Will Hoover on Feb 13, 2008  (view change)

To manually switch the locale:

public final class MyPage extends WebPage {

	...

	add(new Link("languageSwitch") {

		@Override
		public final void onClick() {
			Locale locale = new Locale(MyPage.this.getString("header.versionLanguage"));
			this.getSession().setLocale(locale);
		}

	});

	...

}