[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"article-doc:docs\u002Frealtime\u002Frealtime-translation":3},"---\ntitle: Realtime Translation\ndescription: Source and translated text correspondence, language config, switching, latency.\nstatus: preview\n---\nReal-time translation: get translated text alongside transcription while speech is happening.\n\n::callout{icon=\"i-lucide-triangle-alert\" color=\"amber\"}\nReal-time `translate_to` is **not currently enabled** for external sessions. The public realtime gateway forwards `language` but does not forward `translate_to`, so a `session.update` with that field has no effect.\n::\n\n## Usage\n\n### Configure translation\n\nSet the source language and translation target via `session.update`:\n\n```json\n{\n  \"type\": \"session.update\",\n  \"language\": \"zh\",\n  \"translate_to\": \"en\"\n}\n```\n\n- `language`: source language of the audio\n- `translate_to`: target language for translation\n\n### Translation output\n\nWhen enabled, translation results are returned alongside transcription in the `conversation.item.input_audio_transcription.completed` event.\n\n## Source and translated text correspondence\n\nSource and translation for each utterance arrive in the same `conversation.item.input_audio_transcription.completed` event, ensuring correspondence. No client-side matching needed.\n\n## Switching languages\n\nChange language at any time during the session:\n\n```json\n{ \"type\": \"session.update\", \"language\": \"en\" }\n```\n\nNew utterances after the switch use the new language. In-flight utterances complete with the previous language.\n\n## Latency\n\nTranslation adds additional latency:\n\n| Component | Typical p50 |\n|---|---|\n| STT (transcription) | ~310ms |\n| Translation | ~200ms |\n| End-to-end | ~510ms |\n\nTranslation latency depends on audio length, context, and service load. Measured data on [Service Status](https:\u002F\u002Fcontrol.lansonai.com\u002Fstatus\u002Flanson-audio).\n\n## Multilingual \u002F code-switching\n\n- **Auto-detect**: set `language: \"auto\"`\n- **Mixed language**: upstream supports code-switching, accuracy depends on model and audio quality\n- **Chinese aliases**: `zh-cn`, `zh-tw`, `mandarin` etc. are normalized to `zh`\n\n## UI strategy\n\n1. Receive `conversation.item.input_audio_transcription.completed` event\n2. Display source text on first line\n3. Display translation on second line\n4. Each utterance is independent, no replacement needed\n\nSee [Build Live Translation](\u002Fdocs\u002Fguides\u002Flive-translation) for a detailed guide.\n\n## Related\n\n- [Session Configuration](\u002Fdocs\u002Frealtime\u002Fsession-configuration) — `session.update` details\n- [Live Translation](\u002Fdocs\u002Fconcepts\u002Flive-translation) — translation concepts\n- [Build Live Translation](\u002Fdocs\u002Fguides\u002Flive-translation) — UI guide\n",1790059118959]