Search Tips   |   Advanced Search

Set the language fallback filter

Set the language fallback servlet filter to perform fallback for the entries in the browser locale list. This changes the way by which the portal determines the language for rendering portlets.

By default WebSphere Portal v6.1 recognizes whether a general language code is secondary or farther down in the browser priority list and ignores all regional variations that do not directly match a language defined by the portal. For example, if the browser locale list specifies "ja-JP", "de", "ja", the portal ignores the entry "ja-JP" and falls back to the second entry of "de", as it recognizes that "ja-JP" does not have a match among the portal defined locales and that the more generic version "ja" of this locale is further down in the list behind "de".

This behavior conforms to the HTTP specification.

If you turn the filter on, the portal performs a fallback for all entries and removes duplicates of the fallback locales that appear later in the list. In the example browser locale list of "ja-JP", "de", "ja" as given above, the portal recognizes that "ja-JP" does not match any of the portal defined locales, but performs a fallback to the portal defined locale "ja". It uses "ja" as the locale of choice and ignores the 3rd entry "ja" from the list. The resulting locale list used by the portal is "ja", "de". This bypasses strict adherence to the HTTP specification of accepting and displaying languages and uses the fallback option instead. This also makes your WebSphere Portal v6.1.5 behave the same way as earlier portal versions.

You set this filter in the file web.xml under the directory location profile_root/config/cells/node-name/applications/wps.ear/deployments/wps/wps.war/WEB-INF. By default the portal is set to use the extended locale filter as follows:

   <filter-name>Locale Filter</filter-name>

To switch to the language fallback servlet filter, replace the extended locale filter by the sorting locale filter as follows:

   <filter-name>Locale Filter</filter-name>
Restart the portal for the change to take effect.

For example, assume the browser sends the Accept-Language header "DE_de, en". This means that the user prefers German as spoken in Germany as first priority, then English, but not German in general.

In a portal scenario, this would result in serving resources in "en", even though "de" would be supported (but is not acceptable according to the header). Using the ExtendedLocaleFilter adds all fallback locales to the header, preserving the relative order of the original locales in the header. The result would be "DE_de, en, de", with the fallback to "de" appearing after "en" to match the user preference.

In contrast, com.ibm.wps.engine.SortingLocaleFilter gives fallbacks precedence over the original order of locales in the header.

For "DE_de, en" the filter would generate "DE_de, de, en", giving all fallbacks for "DE_de" the same relative priority as "DE_de".

Users can write their own filters and apply their own locale fallback logic. WebSphere PortalPortal uses the value of the accept-language header for further processing.

IBM Lotus Web Content Management does not use portlets and can therefore not apply the filter that the portal uses for portlets. Therefore, if the portal installation includes Web Content Management, set the filter in the Web Content Management web.xml under the directory location profile_root/config/cells/node-name/applications/wcm.ear/deployments/wcm/ilwwcm.war/WEB-INF/. Replace the extended filter by the sorting locale filter as shown above and restart the portal.

Parent topic:

Language support

Related tasks

Dynamically changing the language during the session

Related information

Supporting a new language
Changing the character set for a language
Select and changing the language