Translation
The translation function allows users who use different languages to be able to communicate easily with each other. The translation function can be implemented in two ways: automatic translation or on-demand translation. Automatic translation sends the results of the automatically translated text to the channel, while on-demand translation allows the user to request the translation of a chat message that has already been received.
Automatic translation
The chat message is automatically translated. When a user sends a message, the chat server distributes the message translated into each language in the channel (based on the members in the same channel). By doing so, users can receive the translated message in real time. You can set the languages to include and exclude in the console to adjust the fee.
Set the activation status and the list of languages in the console.
On-demand translation
Chat messages that have already been received and the target translation language can be requested to the server to receive the translated text. The translated chat is only sent to the user who sent the request.
The following is the callback and call function that allow on-demand translation to be used.
Callback method
// A callback method that allows the translated chat message to be viewed.
void OnTranslateMessage(vector<BackndChat::MessageInfo> messages) { }
Call method
// A function that requests on-demand translation. It sends the chat message to translate and the list of target languages for translation.
BackndChat::BDChatMain::SendTranslateChatMessage(BackndChat::MessageInfo message, vector<string> languages)