Class DefaultLanguageManager

java.lang.Object
com.atlassian.confluence.languages.DefaultLanguageManager
All Implemented Interfaces:
LanguageManager

public class DefaultLanguageManager extends Object implements LanguageManager
  • 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

      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 interface LanguageManager
      Parameters:
      languageKey - The key to retrieve the language for
      Returns:
      A Language object
    • getLanguageMap

      public Map<String,Language> getLanguageMap()
    • getLanguages

      public List<Language> getLanguages()
      Description copied from interface: LanguageManager
      Returns a list of Language objects, representing the currently loaded languages

      The en_GB locale is also added to the list

      The sorting for this list is undefined.

      Specified by:
      getLanguages in interface LanguageManager
      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 interface LanguageManager
      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

      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.
    • getDisplayName

      public String getDisplayName(Language language)