Class ContextStorageTranslationProvider
java.lang.Object
com.e1c.langtool.internal.storage.AbstractStorageTranslationProvider
com.e1c.langtool.internal.storage.ContextStorageTranslationProvider
- All Implemented Interfaces:
IExternalTranslationProvider
The external translation provider source allows to get translation from all project context storages.
This implementation does not support non-context query but only
context.-
Field Summary
Fields inherited from class com.e1c.langtool.internal.storage.AbstractStorageTranslationProvider
translatingProjectManagerFields inherited from interface com.e1c.langtool.external.IExternalTranslationProvider
EXTENSION_POINT_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of translations by the given query.Translates text from a given language to another given language.Translates text from a given language to another given language.Methods inherited from class com.e1c.langtool.internal.storage.AbstractStorageTranslationProvider
getLanguageCodes, getLanguages, getTargetProjectAndLanguage, translateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.e1c.langtool.external.IExternalTranslationProvider
getTranslationItemImageName, isActive
-
Constructor Details
-
ContextStorageTranslationProvider
public ContextStorageTranslationProvider()
-
-
Method Details
-
translate
Description copied from interface:IExternalTranslationProviderTranslates text from a given language to another given language.- Parameters:
text- the string to translatesourceLocale- the code of language to translate fromtargetLocale- the code of language to translate to- Returns:
- the list of possible translations for given text
-
translate
public Map<String,List<String>> translate(List<String> texts, String sourceLocale, String targetLocale) Description copied from interface:IExternalTranslationProviderTranslates text from a given language to another given language. In contrast toIExternalTranslationProvider.translate(String, String, String)this method allows to translate a list of strings for one query to translation service.- Parameters:
texts- the list of strings to translate in the same languagesourceLocale- the code of language to translate fromtargetLocale- the code language to translate to- Returns:
- the map where keys are elements of the given list with strings and values are possible translations for every key in the map
-
translate
Description copied from interface:IExternalTranslationProviderReturns a list of translations by the given query.Default implementation of this method uses
IExternalTranslationProvider.translate(String, String, String)with the following arguments:- text -
ISingleTranslationQuery.getText() - source language -
ITranslationQuery.getSourceLanguage() - target language -
ITranslationQuery.getTargetLanguage()}
- Parameters:
query- the query for translating- Returns:
- a list of translations
- text -
-