Back to docsRecipe

Realtime chat translation

Build a chat room where every message is instantly translated into the reader's preferred language using Meridian streams and a translation provider.

Sub-100ms latency

Messages appear translated before the sender finishes typing.

🌐

12 languages

Each participant reads in their own locale without extra round trips.

🔒

E2E encrypted

Plaintext never touches the translation service; only ciphertext transits Meridian.

Architecture

Client A (en) ──► Meridian stream ──► Client B (ja)
                    │
              Translation edge
              (DeepL / Google Cloud)
                    │
              Translated payload
              broadcast to all subscribers

Key steps

  1. Create a stream — one Meridian stream per chat room, scoped to participants.
  2. Attach translation edge — a lightweight function that detects source language and fans out translations.
  3. Subscribe with locale — each client declares their preferred language on connect.
  4. Render translated payload — the client receives only the message in their language.

Next steps