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 LanguagegetDefaultEnglishLanguage()Returns a Language object with the Locale set to en_GB Also sets the location of the flag URLStringgetDisplayName(Language language)LanguagegetGlobalDefaultLanguage()Returns the language enabled as the global default.LanguagegetLanguage(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 languagesvoidhandlePluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)voidhandlePluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)booleanisDuplicateLanguage(Language language)Determine whether there are at least two language packs for the given language installed.voidsetPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)voidsetPluginEventManager(com.atlassian.plugin.event.PluginEventManager pluginEventManager)voidsetSettingsManager(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:LanguageManagerRetrieves 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:
getLanguagein interfaceLanguageManager- Parameters:
languageKey- The key to retrieve the language for- Returns:
- A Language object
-
getLanguages
public List<Language> getLanguages()
Description copied from interface:LanguageManagerReturns 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:
getLanguagesin interfaceLanguageManager- Returns:
- A list containing Language objects
-
getGlobalDefaultLanguage
public final Language getGlobalDefaultLanguage()
Description copied from interface:LanguageManagerReturns the language enabled as the global default.- Specified by:
getGlobalDefaultLanguagein 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)
-
-