public class DefaultLocaleManager extends Object implements LocaleManager
DEFAULT_LOCALE
Constructor and Description |
---|
DefaultLocaleManager(JiraLocaleUtils jiraLocaleUtils,
I18nHelper.BeanFactory beanFactory) |
Modifier and Type | Method and Description |
---|---|
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(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
|
public DefaultLocaleManager(JiraLocaleUtils jiraLocaleUtils, I18nHelper.BeanFactory beanFactory)
public Set<Locale> getInstalledLocales()
LocaleManager
getInstalledLocales
in interface LocaleManager
public Map<String,String> getInstalledLocalesWithDefault(Locale defaultLocale, I18nHelper i18nHelper)
LocaleManager
getInstalledLocalesWithDefault
in interface LocaleManager
defaultLocale
- The locale to use as the defaulti18nHelper
- Required to internationalize the 'Default'public Locale getLocale(String locale)
LocaleManager
getLocale
in interface LocaleManager
locale
- Locale in string formLocale
objectpublic Locale getLocaleFor(ApplicationUser user)
LocaleManager
getLocaleFor
in interface LocaleManager
user
- The userpublic void validateUserLocale(ApplicationUser loggedInUser, String locale, ErrorCollection errorCollection)
LocaleManager
validateUserLocale
in interface LocaleManager
loggedInUser
- The user performing the operationlocale
- the locale String to validate (e.g. en_UK)errorCollection
- Error collection to record errors inCopyright © 2002-2015 Atlassian. All Rights Reserved.