Thursday, 31 July 2014

Change Default browser behavior language fallback in WPS8.5

When user locale is “es” (spainsh)and browser locale list is "es-cl", "en", "es", the portal ignores the entry "es-cl" and falls back to the second entry of "en". It recognizes that " es-cl " does not have a match among the portal defined locales and that the more generic version "es" of this locale is further down in the list after "en". This behavior conforms to the HTTP specification.

Below all labels are in English.

image

Websphere Portal has built-in language fallback servlet filter supports a mode that extends the language fallback behavior. If you enable this extended language fallback mode, the portal runs a fallback for all entries and removes duplicates of the fallback locales that are later in the list. In the example browser locale list of "es-cl", "en", "es" as given before, the portal recognizes that "es-cl" does not match any of the portal defined locales. Therefore, it runs a fallback to the portal defined locale "es". It uses "es" as the locale of choice and ignores the third entry "es" from the list. The resulting locale list that the portal uses is "es", "en". This fallback mechanism bypasses strict adherence to the HTTP specification of accepting and showing languages and uses the fallback option instead.

Steps to enable language fallback mode

1. Open the WebSphere Integrated Solutions Console.

2. Select the Resource Environment Provider WP ConfigService.

3. In the Custom Properties section, add the property engine.enableExtendedLanguageFallback and set it to the value true.

4. Save your changes.

5. Restart your WebSphere Portal for your changes to take effect.

image

After restart, system shows labels in Spanish

image

No comments:

Post a Comment