Class DefaultLanguageManager

    • Constructor Detail

      • DefaultLanguageManager

        public DefaultLanguageManager()
    • 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 interface LanguageManager
        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 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
      • 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)
      • getDisplayName

        public String getDisplayName​(Language language)
      • setSettingsManager

        public void setSettingsManager​(SettingsManager settingsManager)