Class ContextStorageTranslationProvider

java.lang.Object
com.e1c.langtool.internal.storage.AbstractStorageTranslationProvider
com.e1c.langtool.internal.storage.ContextStorageTranslationProvider
All Implemented Interfaces:
IExternalTranslationProvider

public class ContextStorageTranslationProvider extends AbstractStorageTranslationProvider
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.
  • Constructor Details

    • ContextStorageTranslationProvider

      public ContextStorageTranslationProvider()
  • Method Details

    • translate

      public List<String> translate(String text, String sourceLocale, String targetLocale)
      Description copied from interface: IExternalTranslationProvider
      Translates text from a given language to another given language.
      Parameters:
      text - the string to translate
      sourceLocale - the code of language to translate from
      targetLocale - 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: IExternalTranslationProvider
      Translates text from a given language to another given language. In contrast to IExternalTranslationProvider.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 language
      sourceLocale - the code of language to translate from
      targetLocale - 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

      public List<String> translate(IContextTranslationQuery query)
      Description copied from interface: IExternalTranslationProvider
      Returns a list of translations by the given query.

      Default implementation of this method uses IExternalTranslationProvider.translate(String, String, String) with the following arguments:

      Parameters:
      query - the query for translating
      Returns:
      a list of translations