Class DefaultLanguageManager
java.lang.Object
com.atlassian.confluence.languages.DefaultLanguageManager
- All Implemented Interfaces:
LanguageManager
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultLanguageManager(com.atlassian.plugin.PluginAccessor pluginAccessor) DefaultLanguageManager(com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.plugin.event.PluginEventManager pluginEventManager, GlobalSettingsManager settingsManager) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a List of all enabled LanguageModuleDescriptorsstatic LanguageReturns a Language object with the Locale set to en_GB Also sets the location of the flag URLgetDisplayName(Language language) final LanguageReturns the language enabled as the global default.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 LanguageReturns 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.
-
Constructor Details
-
DefaultLanguageManager
public DefaultLanguageManager(com.atlassian.plugin.PluginAccessor pluginAccessor, com.atlassian.plugin.event.PluginEventManager pluginEventManager, GlobalSettingsManager settingsManager) -
DefaultLanguageManager
public DefaultLanguageManager(com.atlassian.plugin.PluginAccessor pluginAccessor)
-
-
Method Details
-
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
Retrieves a List of all enabled LanguageModuleDescriptors- Returns:
- List containing the LanguageModuleDescriptor objects
-
getLanguage
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
-
getLanguageMap
-
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
Description copied from interface:LanguageManagerReturns the language enabled as the global default.- Specified by:
getGlobalDefaultLanguagein interfaceLanguageManager- Returns:
- the global default language
-
handlePluginModuleDisabled
public void handlePluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event) -
handlePluginModuleEnabled
public void handlePluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event) -
isDuplicateLanguage
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.
-
getDisplayName
-