com.atlassian.sal.api.message
Interface LocaleResolver


public interface LocaleResolver

This interface is responsible for resolving the current locale.

Since:
2.0

Method Summary
 Locale getLocale()
          Resolve the Locale that should be used in internationalization and localization.
 Locale getLocale(javax.servlet.http.HttpServletRequest request)
          Given a request, resolve the Locale that should be used in internationalization and localization.
 Set<Locale> getSupportedLocales()
          Returns a set of all the supported locales by the host application.
 

Method Detail

getLocale

Locale getLocale(javax.servlet.http.HttpServletRequest request)
Given a request, resolve the Locale that should be used in internationalization and localization. The locale should be determined by first checking the remote users preferences, then defaulting to the application default locale if no preferred locale is set.

Parameters:
request - Request to check
Returns:
Locale to be used in i18n and l10n. Locale.getDefault() if none found.

getLocale

Locale getLocale()
Resolve the Locale that should be used in internationalization and localization. The locale should be determined by checking the preferences of the user in the current authentication context if available, then default to the application default locale if no preferred locale is set.

Returns:
Locale to be used in i18n and l10n. Locale.getDefault() if none found.

getSupportedLocales

Set<Locale> getSupportedLocales()
Returns a set of all the supported locales by the host application. This is all the language packs that are installed.

Returns:
an unmodifiable set of all the supported locales by the host application. Must contain at least one locale.


Copyright © 2011 Atlassian. All Rights Reserved.