com.atlassian.jira.config
Interface LocaleManager

All Known Implementing Classes:
DefaultLocaleManager

@PublicApi
public interface LocaleManager

Provides Locale information for this JIRA instance.

Since:
v4.0

Field Summary
static String DEFAULT_LOCALE
          The default locale id.
 
Method Summary
 Set<Locale> getInstalledLocales()
          Returns a set of locales supported by this JIRA instance.
 Map<String,String> getInstalledLocalesWithDefault(Locale defaultLocale, I18nHelper i18nHelper)
          Returns a mapping of localeString to its displayname.
 Locale getLocale(String locale)
          Given a string, return the corresponding Locale.
 Locale getLocaleFor(ApplicationUser user)
          Returns the locale for the given user.
 void validateUserLocale(com.atlassian.crowd.embedded.api.User loggedInUser, String locale, ErrorCollection errorCollection)
          Given a user entered locale string this method ensures that it is in fact a locale that exists in this instance
 

Field Detail

DEFAULT_LOCALE

static final String DEFAULT_LOCALE
The default locale id.

See Also:
Constant Field Values
Method Detail

getInstalledLocales

Set<Locale> getInstalledLocales()
Returns a set of locales supported by this JIRA instance. This is typically the language packs installed.

Returns:
a set of locales supported

getInstalledLocalesWithDefault

Map<String,String> getInstalledLocalesWithDefault(Locale defaultLocale,
                                                  I18nHelper i18nHelper)
Returns a mapping of localeString to its displayname. Also includes a 'Default' locale.

Parameters:
defaultLocale - The locale to use as the default
i18nHelper - Required to internationalize the 'Default'
Returns:
A mapping from localeString to its displayname.

getLocale

Locale getLocale(String locale)
Given a string, return the corresponding Locale.

Parameters:
locale - Locale in string form
Returns:
The Locale object

getLocaleFor

Locale getLocaleFor(ApplicationUser user)
Returns the locale for the given user.

Parameters:
user - The user
Returns:
the locale for the given user.

validateUserLocale

void validateUserLocale(com.atlassian.crowd.embedded.api.User loggedInUser,
                        String locale,
                        ErrorCollection errorCollection)
Given a user entered locale string this method ensures that it is in fact a locale that exists in this instance

Parameters:
loggedInUser - The user performing the operation
locale - the locale String to validate (e.g. en_UK)
errorCollection - Error collection to record errors in


Copyright © 2002-2014 Atlassian. All Rights Reserved.