Archived Portal Exploration View a printable version of the current page.
Locale Manager Configuration
Archived Content

The UP3 space contains documentation related to the next-generation portal exploration work that JA-SIG has now archived. Documentation related to uPortal, including active development for future releases, can be found in the uPortal space.
References to uPortal 3 in this space should be considered out of date. Active uPortal 3 documentation is available in the uPortal space.

Locale Manager Configuration: locale_beans.xml

The locale manager is highly configurable. The locale manager is setup such that it'll take a variable number of preferences and one resolution logic. To add preferences to the locale manager, one has to implement ILocalePreferenceProvider. Once you have the provider, you can just add it to the list on the configuration XML file.

<property name="localePreferenceProviders">
    <list>
        <ref bean="userLocalePreferenceProvider" />
        <ref bean="/uP2Context/browserLocalePreferenceProvider" />
        <ref bean="systemLocalePreferenceProvider" />
        <ref bean="localeListPreferenceProvider" />
    </list>
</property>

The resolution logic for the locale manager is swappable. The current resolution logic is best match. It will try to find an exact locale match from the list of available locales, if it cannot find an exact match it will try to find a language match. If one prefer to use a different resolution logic, just implement ILocaleResolutionProvider.

<property name="localeResolutionProvider">
    <bean class="org.jasig.portal.i18n.MatchLocaleResolutionProvider" />
</property>

List Preference Provider

For flexibility, we have a list preference provider that allows the admin to set a list of locale preferences.

<bean id="localeListPreferenceProvider" class="org.jasig.portal.i18n.LocaleListPreferenceProvider">
    <property name="localePreferences">
        <list>
            <value>en_US</value>
            <value>en</value>
            <value>fr_CA</value>
        </list>
    </property>
</bean>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.