Tag to change the locale from links on IBM WPS 6.0 Theme


Recently we had a requirement to enable portlet application to support multilingual. Initially we were supporting English language (en_US) but the new requirement was to have Spanish (es) support.

The requirement was when user visits the portlet application he should be able to toggle between English and Spanish. At a time only one of the links needs to displayed. The best place to put this link was on Theme level in banner.jspf.

I just wanted to share with you all the useful tag to switch the portal locale at a global level.

<portal-navigation:url command="ChangeLanguage">

This tag is used to change the active language in the navigational state in which the URL is generated.
The following code example uses this tag to change the language to Spanish:
<a href='<portal-navigation:url command="ChangeLanguage"><portal-navigation:urlParam name="locale" value="es"/></portal-navigation:url>'>En Espanol</a>

No comments:

Post a Comment

Recent Posts

Popular Posts

© 2011-2019 Web Portal Club