Interface LocaleManager
-
- All Known Implementing Classes:
DefaultLocaleManager
,DefaultLocaleManager
,SetupLocaleManager
,TestingLocaleManager
public interface LocaleManager
-
-
Field Summary
Fields Modifier and Type Field Description static Locale
DEFAULT_LOCALE
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Locale
getLocale(com.atlassian.user.User user)
default @NonNull LocaleInfo
getLocaleInfo(@Nullable com.atlassian.user.User user)
Locale
getSiteDefaultLocale()
default void
invalidateLocaleInfoCache(@Nullable com.atlassian.user.User user)
void
setLanguage(String language)
Should set the language string as given by Locale (en-gb for example) in a THREAD LOCAL cache.void
setRequestLanguages(String languageString)
Should set the language string from the request in a THREAD LOCAL cache.
-
-
-
Field Detail
-
DEFAULT_LOCALE
static final Locale DEFAULT_LOCALE
-
-
Method Detail
-
getLocale
Locale getLocale(com.atlassian.user.User user)
-
getLocaleInfo
default @NonNull LocaleInfo getLocaleInfo(@Nullable com.atlassian.user.User user)
- Parameters:
user
-- Returns:
- a locale info with requested , selected and selection reason
- Since:
- 6.2.0
-
invalidateLocaleInfoCache
default void invalidateLocaleInfoCache(@Nullable com.atlassian.user.User user)
- Since:
- 6.2.0
-
setRequestLanguages
void setRequestLanguages(String languageString)
Should set the language string from the request in a THREAD LOCAL cache.- Parameters:
languageString
- comma- or semicolon-separated languages
-
setLanguage
void setLanguage(String language)
Should set the language string as given by Locale (en-gb for example) in a THREAD LOCAL cache. Does nothing if the language string is invalid.- Parameters:
language
- target language
-
getSiteDefaultLocale
Locale getSiteDefaultLocale()
- Returns:
- The default site locale, or
DEFAULT_LOCALE
if none is set. - Since:
- 4.3
-
-