WebSphere Portal Server - Portlet Localization for anonymous user

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > January 2007 > Portlet Localization for anonymous user





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Portlet Localization for anonymous user

2007-01-29, 1:18 pm

Portlet jsp pages can be localized by using jstl format tag with resource bundles. However the language preference is set by using portal's 'edit my preferences' dialog.
How can user locale or language choice be changed for anonymous users of portal?

2007-01-29, 7:24 pm

For anonymous users it's picked up from request header set by the browser. For IE see Internet options->Languages...

2007-01-29, 7:24 pm

True, but I need to control among a few locales the app supports. Can I ask user to select a language and then let portal treat it like it does when a registered user sets language preference?
I've noticed that the portal inserts a locale obj in request when a user sets language. Is there a way to mimic it?

Thanks,
Dev Anand Reddy

2007-01-30, 7:30 am

Websphere Portal Server supports the following command which you may insert in your theme or somewhere in the jsp.

<wps:url command="ChangeLanguage"><wps:urlParam name="locale" value="fr"/></wps:url>

<wps:url command="ChangeLanguage"><wps:urlParam name="locale"
value="fr_CH"/></wps:url>


Put the above command in anchor tag of html.
When user clicks on above provided links, the entire locale of the portal server will be changed.

You can query the locale simply by calling PortletRequest objects getLocale() method. Or if you want to get simply the user locale try to get 'accept-language' header from request.




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com