Thanks, this was what I was looking for.
Best Regards,
Christoph
Imants Firsts wrote:
> How about this?
>
> @Inject private PersistentLocale persistentLocale;
> @Inject private RequestGlobals requestGlobals;
>
> public Locale getCurrentLocale() {
> Locale locale = persistentLocale.get()
How about this?
@Inject private PersistentLocale persistentLocale;
@Inject private RequestGlobals requestGlobals;
public Locale getCurrentLocale() {
Locale locale = persistentLocale.get();
return locale != null ? locale :
requestGlobals.getRequest().getLocale();
}
Quoting Christ
Hi,
I use PersistentLocale to switch my pages to different languages. It
works great. I have several links on the top of the page, each one
switching to a different language. When a user clicks "DE", he will get
the German version.
I also want to show the user which language is currently selected