Skip to Content
author's profile photo Former Member
Former Member

Change the language (locale) of the Portal

Hi everybody,

I have to implement internationalization in my Portal.

I do it throws bundle resources in my iview and throws Portal Content Translation for workset name.

But now, I need to implement a iview in which there are 3 flag (english, french and german for example) and when a user clicks on one of these, this changes the Portal language.

Do someone know how I can do that?

I think I have to change the locale of the session on the button clic but I don't find how to di that ..

Thanks,

Fabien

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jun 23, 2005 at 09:39 AM

    Hi Faben!

    I think what u can do is put a MessageResourceBundle.properties file in your src.core

    That properties file will be like

    NewsEN = English News

    NewsFR = French News

    NewsGR = German News

    Create an application ie either abstract portal component where you can use following syntax

    if (language.equals("EN")) response.write(MessageResourceBundle.getString("newsEN"));

    and so on for french and german.

    Also while loading the page u ve to take care of Language otherwise it will return null pointer exception

    so for that following syntax should be added

    if (request.getParameter("lanselected") == null)

    lanselected = EN;

    to toggle in the language u can use java script function onClick... and change the value of lanselected there.

    You can deploy this.

    And create an iView for that par file

    Hope it works and u got it...

    Regards

    Anish

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Kurien,

      All Portal traduction is made with the "Portal Content Translation" under "Content Administration".

      Here you define all workset, page, iview you want to translate.

      Then when I developp iView (JSDynpage & htmlb), I use bundle resources.

      And to change language dynamically , I use :

      IUserFactory userFactory = UMFactory.getUserFactory();

      IUserMaint user = userFactory.getMutableUser((request.getUser().getUniqueID()));

      user.setLocale(Locale.ENGLISH);

      user.commit();

      And so, all is translate: navigation + content

      Regards,

      Fabien

  • Posted on Jun 23, 2005 at 09:47 AM

    Hi Faben!

    I think what u can do is put a MessageResourceBundle.properties file in your src.core

    That properties file will be like

    NewsEN = English News

    NewsFR = French News

    NewsGR = German News

    Create an application ie either abstract portal component where you can use following syntax

    if (language.equals("EN")) response.write(MessageResourceBundle.getString("newsEN"));

    and so on for french and german.

    Also while loading the page u ve to take care of Language otherwise it will return null pointer exception

    so for that following syntax should be added

    if (request.getParameter("lanselected") == null)

    lanselected = EN;

    to toggle in the language u can use java script function onClick... and change the value of lanselected there.

    You can deploy this.

    And create an iView for that par file

    Hope it works and u got it...

    Regards

    Anish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2006 at 07:47 PM

    I am in a similar situation where the Portal language needs to be toggled in a custom iView. I have implemented the change using the getLocale/setLocale as well as the save() and commit() methods of the IUser object.

    Does anyone now know how to force the portal session to refresh, similar to what happens when the user selects "Save" in the standard Personalization iView? This would prevent the user from having to manually refresh their browser window for the new language to take effect.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.