com.atlassian.confluence.languages
Class DefaultLocaleManager

java.lang.Object
  extended by com.atlassian.confluence.languages.DefaultLocaleManager
All Implemented Interfaces:
LocaleManager
Direct Known Subclasses:
TestingLocaleManager

public class DefaultLocaleManager
extends java.lang.Object
implements LocaleManager


Field Summary
 
Fields inherited from interface com.atlassian.confluence.languages.LocaleManager
DEFAULT_LOCALE
 
Constructor Summary
DefaultLocaleManager()
           
 
Method Summary
 java.util.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.
 void setCacheManager(com.atlassian.cache.CacheManager cacheManager)
           
 void setLanguage(java.lang.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(java.lang.String languageString)
          Should set the language string from the request in a THREAD LOCAL cache.
 void setSettingsManager(SettingsManager settingsManager)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 java.util.Locale toLocale(java.lang.String userLocaleString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLocaleManager

public DefaultLocaleManager()
Method Detail

setCacheManager

public void setCacheManager(com.atlassian.cache.CacheManager cacheManager)

setLanguageManager

public void setLanguageManager(LanguageManager languageManager)

getLocale

public java.util.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

toLocale

public java.util.Locale toLocale(java.lang.String userLocaleString)
Specified by:
toLocale in interface LocaleManager

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

setRequestLanguages

public void setRequestLanguages(java.lang.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

setLanguage

public void setLanguage(java.lang.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.

Specified by:
setLanguage in interface LocaleManager


Copyright © 2003-2011 Atlassian. All Rights Reserved.