Class DefaultLocaleManager

    • Method Detail

      • getLocaleInfo

        public final @NonNull LocaleInfo getLocaleInfo​(@Nullable com.atlassian.user.User user)
        Specified by:
        getLocaleInfo in interface LocaleManager
        Returns:
        a locale info with requested , selected and selection reason
      • getLocale

        public 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. Caches the result in the thread-local cache so we only check the preference or settings once per request.
        Specified by:
        getLocale in interface LocaleManager
      • setRequestLanguages

        public void setRequestLanguages​(String languageString)
        Description copied from interface: LocaleManager
        Should set the language string from the request in a THREAD LOCAL cache.
        Specified by:
        setRequestLanguages in interface LocaleManager
        Parameters:
        languageString - comma- or semicolon-separated languages
      • setLanguage

        public void setLanguage​(String language)
        Description copied from interface: LocaleManager
        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.
        Specified by:
        setLanguage in interface LocaleManager
        Parameters:
        language - target language