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 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

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)


Copyright © 2003-2010 Atlassian. All Rights Reserved.