public class DefaultLocaleManager extends Object implements LocaleManager
DEFAULT_LOCALE
Constructor and Description |
---|
DefaultLocaleManager() |
Modifier and Type | Method and Description |
---|---|
Locale |
getLocale(com.atlassian.user.User user)
Returns the user's locale if they have one set in their preferences, otherwise returns the site default locale.
|
LocaleInfo |
getLocaleInfo(com.atlassian.user.User user) |
Locale |
getSiteDefaultLocale() |
UserAccessor |
getUserAccessor() |
void |
invalidateLocaleInfoCache(com.atlassian.user.User user) |
void |
setCacheFactory(com.atlassian.vcache.VCacheFactory cacheFactory) |
void |
setCacheManager(com.atlassian.cache.CacheManager cacheManager)
Deprecated.
since 5.10 Use
setCacheFactory(VCacheFactory) |
void |
setLanguage(String language)
Should set the language string as given by Locale (en-gb for example) in a THREAD LOCAL cache.
|
void |
setLanguageManager(LanguageManager languageManager) |
void |
setRequestLanguages(String languageString)
Should set the language string from the request in a THREAD LOCAL cache.
|
void |
setSettingsManager(SettingsManager settingsManager) |
void |
setUserAccessorSupplier(com.atlassian.util.concurrent.Supplier<UserAccessor> userAccessorSupplier) |
public void setUserAccessorSupplier(com.atlassian.util.concurrent.Supplier<UserAccessor> userAccessorSupplier)
@Deprecated public void setCacheManager(com.atlassian.cache.CacheManager cacheManager)
setCacheFactory(VCacheFactory)
public void setCacheFactory(com.atlassian.vcache.VCacheFactory cacheFactory)
public void setLanguageManager(LanguageManager languageManager)
public final void invalidateLocaleInfoCache(@Nullable com.atlassian.user.User user)
invalidateLocaleInfoCache
in interface LocaleManager
@Nonnull public final LocaleInfo getLocaleInfo(@Nullable com.atlassian.user.User user)
getLocaleInfo
in interface LocaleManager
public Locale getLocale(com.atlassian.user.User user)
getLocale
in interface LocaleManager
public Locale getSiteDefaultLocale()
getSiteDefaultLocale
in interface LocaleManager
LocaleManager.DEFAULT_LOCALE
if none is set.public void setSettingsManager(SettingsManager settingsManager)
public UserAccessor getUserAccessor()
public void setRequestLanguages(String languageString)
LocaleManager
setRequestLanguages
in interface LocaleManager
languageString
- comma- or semicolon-separated languagespublic void setLanguage(String language)
LocaleManager
setLanguage
in interface LocaleManager
language
- target languageCopyright © 2003–2017 Atlassian. All rights reserved.