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()
LocaleManagergetInstalledLocales in interface LocaleManagerpublic Map<String,String> getInstalledLocalesWithDefault(Locale defaultLocale, I18nHelper i18nHelper)
LocaleManagergetInstalledLocalesWithDefault in interface LocaleManagerdefaultLocale - The locale to use as the defaulti18nHelper - Required to internationalize the 'Default'public Locale getLocale(String locale)
LocaleManagergetLocale in interface LocaleManagerlocale - Locale in string formLocale objectpublic Locale getLocaleFor(ApplicationUser user)
LocaleManagergetLocaleFor in interface LocaleManageruser - The userpublic void validateUserLocale(ApplicationUser loggedInUser, String locale, ErrorCollection errorCollection)
LocaleManagervalidateUserLocale in interface LocaleManagerloggedInUser - The user performing the operationlocale - the locale String to validate (e.g. en_UK)errorCollection - Error collection to record errors inCopyright © 2002-2021 Atlassian. All Rights Reserved.