Interface IExternalTranslationManager

All Known Implementing Classes:
ExternalTranslationManager

public interface IExternalTranslationManager
This interface provides translating using registered providers of external translation services.

IExternalTranslationManager allows:

  • to get registered external translation providers and their ids by translation provider manager
  • to translate text (or list of texts) with the provider specified by id
  • to get the list of supported languages for provider specified by id

  • Method Details

    • getTranslationProviderRegistry

      ITranslationProviderRegistry getTranslationProviderRegistry()
      Returns the external translation providers registry.
      Returns:
      the external translation providers registry
    • translate

      List<String> translate(ISingleTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Translates text using the provider specified by id.

      This method gets text to translate from query using ITranslationQuery#getText() method.

      Parameters:
      query - the query with arguments of translation
      providerId - the id of specified provider
      monitor - the progress monitor
      Returns:
      the list of possible translations for given text
    • translate

      List<String> translate(IContextTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Translates the given query using the provider specified by id.
      Parameters:
      query - the query that contains data to translate
      providerId - the id of specified provider
      monitor - the progress monitor
      Returns:
      the list of possible translations for given query
    • translate

      Map<String,List<String>> translate(IMultiTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Translates texts using the provider specified by id.

      This method gets list of texts to translate from query using ITranslationQuery#getTexts() method.

      Parameters:
      query - the query with arguments of translation
      providerId - the id of specified provider
      monitor - the progress monitor
      Returns:
      the list of possible translations for given text
    • getSupportedLanguages

      List<String> getSupportedLanguages(String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Returns the list of supported languages for provider specified by id.
      Parameters:
      providerId - the id of specified provider
      monitor - the progress monitor
      Returns:
      the list of supported languages for provider specified by id