Hi Behi,

I had this problem also. Lieray has iths own User where the language is
stored (also the timezone). 
This is not updated within the respones of MyFaces.

Here a snipped which could help you:

  import com.liferay.portal.model.User;
  import com.liferay.portal.util.PortalUtil;

  public MyUser getUser(final RenderRequest request) {
    MyUser user;

    try {
      final User liferayUser = PortalUtil.getUser(request);
      user =
          new VIIBPortalUser(liferayUser.getFirstName(),
              liferayUser.getLastName());
      user.setLocale(liferayUser.getLocale());
      user.setTimeZone(liferayUser.getTimeZone());
    }
    catch (final Exception e) {
      user = null;
    }


    return user;
  }

Regards,

Stephan

> -----Original Message-----
> From: Behrang Saeedzadeh [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, August 22, 2006 3:51 PM
> To: [email protected]
> Subject: Re: Locale problem with MyFaces Portlet for Liferay
> 
> Oh I forgot to ask my question: does anybody know what's wrong with
> this portlet?
> 
> Regards,
> Behi
> 
> On 8/22/06, Behrang Saeedzadeh <[EMAIL PROTECTED]> wrote:
> > Hi guys,
> >
> > I have written a simple blank JSF portlet for Liferay. It supports 2
> > locales: "en" and "de". But when I change the locale of the 
> user, the
> > portlet doesn't fetch the appropriate locale and instead 
> only fetches
> > the default locale.
> >
> > The whole portlet with its war file ready to be deployed 
> can be access
> > from 
> http://my.opera.com/behrangsa/homes/projects/BlankLiferayPortlet.zip
> >
> > Thanks in advance,
> > Behi
> >
> > --
> > "We can only see a short distance ahead,
> > but we can see plenty there
> > that needs to be done." - Alan Turing
> >
> > "Science is a differential equation. Religion
> > is a boundary condition" - Alan Turing
> >
> > Behrang Saeedzadeh
> > http://www.jroller.com/page/behrangsa
> > http://my.opera.com/behrangsa
> >
> 
> 
> -- 
> "We can only see a short distance ahead,
> but we can see plenty there
> that needs to be done." - Alan Turing
> 
> "Science is a differential equation. Religion
> is a boundary condition" - Alan Turing
> 
> Behrang Saeedzadeh
> http://www.jroller.com/page/behrangsa
> http://my.opera.com/behrangsa
> 

Reply via email to