Interface TranslationResult

All Known Implementing Classes:
TranslationResultImpl

public interface TranslationResult
The TranslationResult is returned from all translation calls. It contains the translated string as well as other data related to the translation call. It is possible some of the values returned from a service will be NULL but the TranslationResult object it self will never return as NULL.
  • Method Details

    • getTranslation

      String getTranslation()
      Gets the translation.
      Returns:
      The translation response from the Machine Translation engine
    • getSourceLanguage

      String getSourceLanguage()
      Gets the source language.
      Returns:
      The original source language. If this was not specified during the translation call it is determined by leveraging the Translation Detection functionality
    • getTargetLanguage

      String getTargetLanguage()
      Gets the target language.
      Returns:
      The target language. If this was not specified during the translation call it may be determined based on the Resource path, Resource locale, or locale of the user.
    • getContentType

      Gets the content type.
      Returns:
      The content type of the Source String and the Target String it was translated into.
    • getCategory

      String getCategory()
      Gets the category.
      Returns:
      The content category. If this was not specified during the translation call it is defaulted to "general"
    • getSourceString

      String getSourceString()
      Gets the source string.
      Returns:
      The original source String that was translated.
    • getRating

      int getRating()
      Gets the rating.
      Returns:
      The rating of the returned translation. If unknown this will return -999.
    • getUserId

      String getUserId()
      Gets the user id.
      Returns:
      The ID corresponding to the user who edited the current translation. This might be the user who is currently editing a translation (@see TranslationService.storeTranslation) or the user who edited the currently returned translation (@see TranslationService.translateString). This field might be blank or null depending on the availability of this data.