Class ExternalTranslationManager
java.lang.Object
com.e1c.langtool.internal.external.ExternalTranslationManager
- All Implemented Interfaces:
IExternalTranslationManager
The implementation of the
IExternalTranslationManager interface.
This manager allows processing texts and caching translation results.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSupportedLanguages(String providerId, org.eclipse.core.runtime.IProgressMonitor monitor) Returns the list of supported languages for provider specified by id.Returns the external translation providers registry.translate(IContextTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor) Translates the given query using the provider specified by id.translate(IMultiTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor) Translates texts using the provider specified by id.translate(ISingleTranslationQuery query, String providerId, org.eclipse.core.runtime.IProgressMonitor monitor) Translates text using the provider specified by id.
-
Constructor Details
-
ExternalTranslationManager
public ExternalTranslationManager()
-
-
Method Details
-
getTranslationProviderRegistry
Description copied from interface:IExternalTranslationManagerReturns the external translation providers registry.- Specified by:
getTranslationProviderRegistryin interfaceIExternalTranslationManager- 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:IExternalTranslationManagerTranslates text using the provider specified by id.This method gets text to translate from query using
ITranslationQuery#getText()method.- Specified by:
translatein interfaceIExternalTranslationManager- Parameters:
query- the query with arguments of translationproviderId- the id of specified providermonitor- 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:IExternalTranslationManagerTranslates the given query using the provider specified by id.- Specified by:
translatein interfaceIExternalTranslationManager- Parameters:
query- the query that contains data to translateproviderId- the id of specified providermonitor- 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:IExternalTranslationManagerTranslates texts using the provider specified by id.This method gets list of texts to translate from query using
ITranslationQuery#getTexts()method.- Specified by:
translatein interfaceIExternalTranslationManager- Parameters:
query- the query with arguments of translationproviderId- the id of specified providermonitor- 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:IExternalTranslationManagerReturns the list of supported languages for provider specified by id.- Specified by:
getSupportedLanguagesin interfaceIExternalTranslationManager- Parameters:
providerId- the id of specified providermonitor- the progress monitor- Returns:
- the list of supported languages for provider specified by id
-