Skip to main content

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

  1. User hovers/long-presses a text message → context menu appears
  2. “Translate” option is shown (for non-deleted text messages only)
  3. User clicks “Translate” → plugin calls the translation extension API
  4. Translated text is stored in the message’s metadata (translated_message key)
  5. 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).

Conversation Preview

Returns empty string — this plugin doesn’t handle conversation previews.

Requirements

The CometChat Message Translation extension must be enabled in your CometChat Dashboard under Extensions.

Installation

The Message Translation plugin is NOT included in the default plugins. Add it explicitly: