Dynamically changing the language during the session
Allow users to change the language during their session.
If you want users to be able to change the language during the session, use the following command provided by WebSphere Portal:
<portal-navigation:url command="ChangeLanguage"> <portal-navigation:urlParam name="locale" value="language"/> </portal-navigation:url>where language is the two character code for the required language, such as en, de, or fr. For a list of the available languages and their two character codes refer to Language support.
For users to be able to dynamically change the language for the session, add a link to the portal theme with the following text and link reference:
Users can then click this link to change to the language specified by the locale parameter with the command. To make more than one language available to users, you create a separate link for each language.
- The text displayed with the link specifies the language to change to.
- The link reference calls the command described above with the locale parameter corresponding to the specified language.
Example: To create links for English and German, add the lines shown in the following example to the banner area of theme:<!-- add these lines --> <a href="<portal-navigation:url command="ChangeLanguage"><portal-navigation:urlParam name="locale" value="en"/></portal-navigation:url>">English</a> <a href="<portal-navigation:url command="ChangeLanguage"><portal-navigation:urlParam name="locale" value="de"/></portal-navigation:url>">Deutsch</a> <%-- logout button --%>The banner area can be defined in different files, depending on the different themes. Themes in recent portal versions commonly define the banner area within the Default.jsp, whereas older themes can include a separate JSP, such as banner_toolbar.jsp. For more information about locating the files for themes refer to the topic about the Location of theme resources.
Notes:
- The changed setting applies only for the duration of the current session. When the user logs out and back in again, the portal applies the default language as determined by the steps described under Selecting and changing the language.
- The previous examples use the portal: prefix to designate JSP tags from the portal tag library in portal.tld. Your custom JSPs might use a different tag prefix. Refer to Tags used by the portal JSPs for more information.
- Important for every OS: Touch the Default.jsp file after editing any JSP files and before any restart. This updates the timestamp on the file to the current time and will signal a recompile of Default.jsp to incorporate the edit changes from other JSP files. Enter:
touch Default.jsp
An alternative is to edit (open and save) Default.jsp, which has the same effect as the touch command. After updating theme JSPs, restart WebSphere Portal unless JSP reloading is enabled.
Parent
Language support
Set the language fallback filter
Location of theme resources
Support a new language
Change the character set for a language
Set the the language
Tags used by the portal JSPs