2 Replies Latest reply on Sep 21, 2006 10:29 AM by Peter Halverson

    Change Locale Portlet

    Michael Singer Newbie

      Hi all,

      I want to write a portlet where the user can change the language for the whole portal.

      Can anybode give me a hint where to set the language so that after the language-change request the whole portal (all portlets on the current page) is rendered with the selected language?

      Any advice would be helpful...

        • 1. Re: Change Locale Portlet
          Peter Halverson Newbie

          I'm right in the midst of writing just such a task, and I think it's pretty straightforward (assuming you understand how to modify JBoss Portal interceptor chains :-) The current JBoss component that determines the Locale associated with the current request (org.jboss.portal.core.aspects.server.LocaleInterceptor) does so by looking at 1) the user's account preferences, and 2) the user's browser preferences (in that order). My intent is to extend that component to look for a preferred Locale in the session before trying the other sources (there's actually a comment in the source code alluding to this strategy). A portlet can then just provide an action to set a Locale in the session. Hope this makes sense.

          Of course all your portlets and themes need to be Locale-aware for this to have any effect. Some of the stock JBoss portlets (e.g. Navigation) are not.

          p