Class ExternalTranslationManager

java.lang.Object
com.e1c.langtool.internal.external.ExternalTranslationManager
All Implemented Interfaces:
IExternalTranslationManager

public class ExternalTranslationManager extends Object implements IExternalTranslationManager
The implementation of the IExternalTranslationManager interface.

This manager allows processing texts and caching translation results.

See Also:
  • Constructor Details

    • ExternalTranslationManager

      public ExternalTranslationManager()
  • Method Details

    • getTranslationProviderRegistry

      public ITranslationProviderRegistry getTranslationProviderRegistry()
      Description copied from interface: IExternalTranslationManager
      Returns the external translation providers registry.
      Specified by:
      getTranslationProviderRegistry in interface IExternalTranslationManager
      Returns:
      the external translation providers registry
    • translate

      public List<String> translate(ISingleTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: IExternalTranslationManager
      Translates text using the provider specified by id.

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

      Specified by:
      translate in interface IExternalTranslationManager
      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

      public List<String> translate(IContextTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: IExternalTranslationManager
      Translates the given query using the provider specified by id.
      Specified by:
      translate in interface IExternalTranslationManager
      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

      public Map<String,List<String>> translate(IMultiTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: IExternalTranslationManager
      Translates texts using the provider specified by id.

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

      Specified by:
      translate in interface IExternalTranslationManager
      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

      public List<String> getSupportedLanguages(String providerId, org.eclipse.core.runtime.IProgressMonitor monitor)
      Description copied from interface: IExternalTranslationManager
      Returns the list of supported languages for provider specified by id.
      Specified by:
      getSupportedLanguages in interface IExternalTranslationManager
      Parameters:
      providerId - the id of specified provider
      monitor - the progress monitor
      Returns:
      the list of supported languages for provider specified by id