IDPv3 internationalization via links and cookies
Simon Lundström
simlu at su.se
Tue Nov 3 03:47:47 EST 2015
Hi!
Thank you for making it so much easier to do i18n in v3! Even though
this is the first time using Spring for me it's much cleaner and easier
than our v2 solution which was *very* hackish.
What we had and what we still want to be able to provide is for our
users to be able to change locale based on:
1. Accept-Language header
2. A link on the login page
3. Store the choice in a cookie
1 is of course already implemented and just works.
3 is easy, just put:
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="cookieName" value="lang"/>
</bean>
in %{idp.home}/system/conf/mvc-beans.xml
For 2 I've found a solution, but I haven't been able to make it work yet.
I found the officals docs for it[1] but since I didn't know what the "mappings"
should be I tried to remove it and by just appending "&lang=en_GB" to
the URL didn't work so I'm guessing that "mappings" needs to be
specified. Can someone shed some light here?
Is there a file in %{idp.home}/conf/ that can be used instead of mvc-beans.xml?
I'd prefer not to change anything in system (since you also advice against it).
BR,
- Simon
1, <http://docs.spring.io/spring/docs/4.1.5.RELEASE/spring-framework-reference/htmlsingle/#mvc-localeresolver-interceptor>
____________________________________
Simon Lundström
Section for Infrastructure
IT Services
Stockholm University
SE-106 91 Stockholm, Sweden
www.su.se/english/staff-info/it
More information about the users
mailing list