Interface AutomaticTranslationService


  • public interface AutomaticTranslationService
    • Method Detail

      • addConnector

        void addConnector​(AutomaticTranslationComponentPlugin translationConnector)
        Add a translation connector
        Parameters:
        translationConnector - The connector to add
      • getActiveConnector

        String getActiveConnector()
        Get current Active connector
        Returns:
        The connector name
      • setActiveConnector

        void setActiveConnector​(String name)
        Set the active connector
        Parameters:
        name - The connector name to activate
      • setApiKey

        void setApiKey​(String connector,
                       String apikey)
        Set the apiKey for the provided connector
        Parameters:
        connector - The connector name
        apikey - The apikey to set
      • translate

        String translate​(String message,
                         Locale targetLang,
                         String contentType,
                         long spaceId)
        Translate a message in the provided locale, by using the active connector
        Parameters:
        message - The message to translate
        targetLang - The locale in which we want to translate
        contentType - The type of the content translated (activity, comment, news ...)
        spaceId - The space in which the content is present
        Returns:
        The translated message
      • isFeatureActive

        boolean isFeatureActive()
        Return if the feature is active
        Returns:
        true if the feature is active