hyphenate_SDK3.0 4.0.0
hyphenate java IM SDK
Public Member Functions | Static Public Attributes | List of all members
com.hyphenate.chat.EMTranslationManager Class Reference

Public Member Functions

void init (EMTranslateParams params)
 
boolean isInitialized ()
 
List< EMLanguagegetSupportedLanguages ()
 
void translate (String messageId, String conversationId, String messageText, String targetLanguageCode, EMValueCallBack< EMTranslationResult > callback)
 
void removeTranslationResult (String messageId)
 
void removeTranslationResults (List< String > messageIds)
 
void clearTranslations ()
 
void removeResultsByConversationId (String conversationId)
 
EMTranslationResult getTranslationResult (String messageId)
 
boolean isTranslationResultForMessage (String messageId)
 
void logout ()
 
void updateTranslationResult (EMTranslationResult result)
 

Static Public Attributes

static final int MaxTranslationTextSize = 5000
 

Detailed Description

The translation information management class, which is responsible for searching for, adding, modifying, and deleting translation information that is saved in the SDK local database.

Deprecated:
use EMChatManager#fetchSupportLanguages(EMValueCallBack) EMChatManager#translateMessage(EMMessage, List, EMValueCallBack) instead.

Member Function Documentation

◆ clearTranslations()

void com.hyphenate.chat.EMTranslationManager.clearTranslations ( )

Deletes all translation records.

◆ getSupportedLanguages()

List< EMLanguage > com.hyphenate.chat.EMTranslationManager.getSupportedLanguages ( )

Gets the list of supported languages for translation.

Returns
The list of supported languages for translation.

◆ getTranslationResult()

EMTranslationResult com.hyphenate.chat.EMTranslationManager.getTranslationResult ( String  messageId)

Gets translation records by message ID.

Parameters
messageIdThe message ID.

◆ init()

void com.hyphenate.chat.EMTranslationManager.init ( EMTranslateParams  params)

Initializes translation parameters.

Parameters
paramsThe parameter objects.

◆ isInitialized()

boolean com.hyphenate.chat.EMTranslationManager.isInitialized ( )

Whether the initialization is completed.

Returns
boolean - true: Yes;
  • false: No.

◆ isTranslationResultForMessage()

boolean com.hyphenate.chat.EMTranslationManager.isTranslationResultForMessage ( String  messageId)

Checks whether there are translation records in the cache.

Parameters
messageIdThe message ID.

◆ logout()

void com.hyphenate.chat.EMTranslationManager.logout ( )

Resets parameters to clear the cache.

◆ removeResultsByConversationId()

void com.hyphenate.chat.EMTranslationManager.removeResultsByConversationId ( String  conversationId)

Deletes translation records by the conversation ID.

Parameters
conversationIdThe conversation ID.

◆ removeTranslationResult()

void com.hyphenate.chat.EMTranslationManager.removeTranslationResult ( String  messageId)

Deletes translation records by the message ID.

Parameters
messageIdThe message ID.

◆ removeTranslationResults()

void com.hyphenate.chat.EMTranslationManager.removeTranslationResults ( List< String >  messageIds)

Batch delete translation records by the message ID.

Parameters
messageIdsThe message ID array.

◆ translate()

void com.hyphenate.chat.EMTranslationManager.translate ( String  messageId,
String  conversationId,
String  messageText,
String  targetLanguageCode,
EMValueCallBack< EMTranslationResult callback 
)

Translates the text.

Parameters
messageIdThe message ID.
conversationIdThe conversation ID.
messageTextThe text to be translated.
targetLanguageCodeThe code of the target language in Microsoft Translation Service.
Returns
The translation record.

◆ updateTranslationResult()

void com.hyphenate.chat.EMTranslationManager.updateTranslationResult ( EMTranslationResult  result)

Updates the translation records.

Parameters
resultThe translation record object.

The documentation for this class was generated from the following file: