AI Integration Quick Reference
AI Integration Quick Reference
Overview
The Message Translation plugin is an enhancer plugin — it doesn’t own a message type or render bubbles. Instead, it adds a “Translate” option to the context menu of text messages. When triggered, it calls the CometChat translation extension API to translate the message into the user’s browser language.Live Preview — text bubble with translation applied.Open in Storybook ↗
How It Works
- User hovers/long-presses a text message → context menu appears
- “Translate” option is shown (for non-deleted text messages only)
- User clicks “Translate” → plugin calls the translation extension API
- Translated text is stored in the message’s metadata (
translated_messagekey) - The text bubble re-renders showing the translation below the original
Plugin Details
Context Menu Option
The translation target language is detected from
navigator.language (e.g., en, fr, de).