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 Object
implements LocaleManager


Field Summary
 
Fields inherited from interface com.atlassian.confluence.languages.LocaleManager
DEFAULT_LOCALE
 
Constructor Summary
DefaultLocaleManager()
           
 
Method Summary
 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(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 setUserAccessor(UserAccessor userAccessor)
           
 Locale toLocale(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 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 Locale toLocale(String userLocaleString)
Specified by:
toLocale in interface LocaleManager

setSettingsManager

public void setSettingsManager(SettingsManager settingsManager)

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

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

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


Copyright © 2003-2011 Atlassian. All Rights Reserved.