LogoLogo
ALO.ai
Developer Documentation
Developer Documentation
  • Developer Documentation
  • Developer Account
    • API Key
  • SDKs
    • Authentication
    • Chat
      • Configuration
      • Send Messages
        • Upload Files
      • Message History
      • Message Actions
      • Message Counts
      • Translation
      • Typing Indicators
      • API Reference
        • Event
        • Message
    • Presence
      • Configuration
      • Basic Usage
      • Methods
    • Audio
      • Prerequisites
      • Instantiating Audio Service
      • Connect to a Channel
      • Disconnecting Audio Service
      • Push To Talk (PTT)
      • Full Duplex
      • Mute and Unmute Audio
      • Input/Output Device Selection
        • Microphone Selection
        • Speaker Selection
      • Channel Participants
      • Text To Speech Audio (TTS)
      • Automatic Reconnects
      • Handling Events
      • Classes
        • AloAudio
        • AudioUser
        • AudioChannel
        • Participant
    • Video
      • Prerequisites
      • Instantiating Video Service
      • Connect to a Channel
      • Disconnecting Video Service
      • Input Device Selection
        • Microphone Selection
        • Camera Selection
      • Publishing Streams
      • Modifying Published Streams
      • Channel Participants
      • Rendering Streams
        • Local Stream
        • Remote Streams
      • Muting/Unmuting Remote Streams
      • Recording Video (coming soon)
      • Automatic Reconnects
      • Handling Events
      • Classes
        • AloVideo
        • Participant
        • VideoChannel
        • VideoUser
  • ALO APPS
    • Overview
    • Creating Apps
    • Webhooks
      • Verifying Requests from ALO
    • Custom Action Forms
    • Using the ALO Platform API
  • ALO Platform API
    • Overview
    • Authentication
    • API
      • Actions and Periods
      • Channels
      • Channel Messages
      • Channel Users
      • Direct Message Channels
      • Direct Message Channel Chat Messages
      • Direct Message Channel Users
      • Groups
      • Periods
      • Types
      • Users
      • Video Management System
  • Misc
    • Supported Language Codes
Powered by GitBook
LogoLogo

ALO.ai

  • ALO.ai

© Copyright 2025 ALO.ai, Inc. • All Rights Reserved

On this page
  1. SDKs
  2. Chat

Translation

Have seamless cross-language conversations by specifying source and target language codes in the message metadata, ensuring real-time translations between speakers of different languages

PreviousMessage CountsNextTyping Indicators

Last updated 8 months ago

You can provide a chat experience between speakers of two different languages by simply specifying the language codes when sending a message and using the i18n payload of a message to render translations in your chat application. You must set sourceLanguageCode and targetLanguageCodes in the metadata of the message.

chat.sendMessage({
    channelId: "alpha",
    content: "<p>Good morning, how are you?</p>",
    metadata: {
        sourceLanguageCode: "en",
        targetLanguageCodes: ["es", "zh"]
    },
});  

An message.i18n.updated event will be published for each completed translation and the message will have a populated i18n key, that in our example will look like this:

{
    "es": {
        content: "<p>¿Buenos días cómo estás?</p>"
    },
    "zh": {
        content: "<p>早上好你好嗎?</p>"
    }
}

The message.i18n.updated events will always come after the message.new event. Translations are generated asynchronously and so you should handle this in your user interface appropriately.

See for languages that are currently supported.

Supported Language Codes