Class DefaultLanguageManager
- java.lang.Object
-
- com.atlassian.confluence.languages.DefaultLanguageManager
-
- All Implemented Interfaces:
LanguageManager
public class DefaultLanguageManager extends Object implements LanguageManager
-
-
Constructor Summary
Constructors Constructor Description DefaultLanguageManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LanguageModuleDescriptor>
getAvailableLanguageDescriptors()
Retrieves a List of all enabled LanguageModuleDescriptorsstatic Language
getDefaultEnglishLanguage()
Returns a Language object with the Locale set to en_GB Also sets the location of the flag URLString
getDisplayName(Language language)
Language
getGlobalDefaultLanguage()
Returns the language enabled as the global default.Language
getLanguage(String languageKey)
Retrieves the Language for the given key Null is returned when a plugin with languageKey could not be found, or it was not a LanguageMap<String,Language>
getLanguageMap()
List<Language>
getLanguages()
Returns a list of Language objects, representing the currently loaded languagesvoid
handlePluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
void
handlePluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
boolean
isDuplicateLanguage(Language language)
Determine whether there are at least two language packs for the given language installed.void
setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
void
setPluginEventManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
void
setSettingsManager(SettingsManager settingsManager)
-
-
-
Method Detail
-
getDefaultEnglishLanguage
public static Language getDefaultEnglishLanguage()
Returns a Language object with the Locale set to en_GB Also sets the location of the flag URL- Returns:
- the english language default
-
getAvailableLanguageDescriptors
public List<LanguageModuleDescriptor> getAvailableLanguageDescriptors()
Retrieves a List of all enabled LanguageModuleDescriptors- Returns:
- List containing the LanguageModuleDescriptor objects
-
getLanguage
public Language getLanguage(String languageKey)
Description copied from interface:LanguageManager
Retrieves the Language for the given key Null is returned when a plugin with languageKey could not be found, or it was not a Language- Specified by:
getLanguage
in interfaceLanguageManager
- Parameters:
languageKey
- The key to retrieve the language for- Returns:
- A Language object
-
getLanguages
public List<Language> getLanguages()
Description copied from interface:LanguageManager
Returns a list of Language objects, representing the currently loaded languagesThe en_GB locale is also added to the list
The sorting for this list is undefined.
- Specified by:
getLanguages
in interfaceLanguageManager
- Returns:
- A list containing Language objects
-
getGlobalDefaultLanguage
public final Language getGlobalDefaultLanguage()
Description copied from interface:LanguageManager
Returns the language enabled as the global default.- Specified by:
getGlobalDefaultLanguage
in interfaceLanguageManager
- Returns:
- the global default language
-
setPluginAccessor
public void setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
handlePluginModuleDisabled
public void handlePluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
-
handlePluginModuleEnabled
public void handlePluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
-
isDuplicateLanguage
public boolean isDuplicateLanguage(Language language)
Determine whether there are at least two language packs for the given language installed. For example, if the given language is en_GB, and en_US is also installed, this will return true.- Parameters:
language
-- Returns:
- true if at least two language packs are installed for the given language.
-
setPluginEventManager
public void setPluginEventManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager)
-
setSettingsManager
public void setSettingsManager(SettingsManager settingsManager)
-
-