Package com.atlassian.jira.config
Class DefaultLocaleManager
java.lang.Object
com.atlassian.jira.config.DefaultLocaleManager
- All Implemented Interfaces:
LocaleManager
-
Field Summary
Fields inherited from interface com.atlassian.jira.config.LocaleManager
DEFAULT_LOCALE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLocaleManager(JiraLocaleUtils jiraLocaleUtils, I18nHelper.BeanFactory beanFactory) -
Method Summary
Modifier and TypeMethodDescriptionReturns a set of locales supported by this JIRA instance.getInstalledLocalesWithDefault(Locale defaultLocale, I18nHelper i18nHelper) Returns a mapping of localeString to its displayname.Given a string, return the corresponding Locale.getLocaleFor(ApplicationUser user) Returns the locale for the given user.voidvalidateUserLocale(ApplicationUser 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
-
Constructor Details
-
DefaultLocaleManager
-
-
Method Details
-
getInstalledLocales
Description copied from interface:LocaleManagerReturns a set of locales supported by this JIRA instance. This is typically the language packs installed.- Specified by:
getInstalledLocalesin interfaceLocaleManager- Returns:
- a set of locales supported
-
getInstalledLocalesWithDefault
public Map<String,String> getInstalledLocalesWithDefault(Locale defaultLocale, I18nHelper i18nHelper) Description copied from interface:LocaleManagerReturns a mapping of localeString to its displayname. Also includes a 'Default' locale.- Specified by:
getInstalledLocalesWithDefaultin interfaceLocaleManager- Parameters:
defaultLocale- The locale to use as the defaulti18nHelper- Required to internationalize the 'Default'- Returns:
- A mapping from localeString to its displayname.
-
getLocale
Description copied from interface:LocaleManagerGiven a string, return the corresponding Locale.- Specified by:
getLocalein interfaceLocaleManager- Parameters:
locale- Locale in string form- Returns:
- The
Localeobject
-
getLocaleFor
Description copied from interface:LocaleManagerReturns the locale for the given user.- Specified by:
getLocaleForin interfaceLocaleManager- Parameters:
user- The user- Returns:
- the locale for the given user.
-
validateUserLocale
public void validateUserLocale(ApplicationUser loggedInUser, String locale, ErrorCollection errorCollection) Description copied from interface:LocaleManagerGiven a user entered locale string this method ensures that it is in fact a locale that exists in this instance- Specified by:
validateUserLocalein interfaceLocaleManager- Parameters:
loggedInUser- The user performing the operationlocale- the locale String to validate (e.g. en_UK)errorCollection- Error collection to record errors in
-