AI Agent Component Spec
AI Agent Component Spec
Overview
This guide shows you how to enable message translation in your chat. Translation lets users translate messages to their preferred language with a single click. Time estimate: 5 minutesDifficulty: Beginner
Prerequisites
- React.js setup complete
- Messaging configured
- CometChat account with Translation extension access
Steps
Step 1: Enable Translation Extension
- Go to your CometChat Dashboard
- Navigate to Extensions → User Engagement
- Enable Message Translation
Step 2: Auto-Integration
Once enabled, translation automatically integrates into your chat:
Step 3: Translate Messages
Users can translate messages through the UI:- Long-press or right-click on a message
- Select “Translate” from the action menu
- The translated text appears below the original message
Complete Example
Full chat with translation:Advanced Configuration
Advanced Configuration
Translate Messages Programmatically
Auto-Translate All Messages
Set up automatic translation for incoming messages:Custom Translation UI
Build a custom translation component:Supported Languages
Common language codes:en- Englishes- Spanishfr- Frenchde- Germanit- Italianpt- Portuguesezh- Chineseja- Japaneseko- Koreanar- Arabichi- Hindiru- Russian
Styling
Customize translation appearance:Common Issues
| Issue | Solution |
|---|---|
| Translate option not showing | Enable extension in Dashboard |
| Translation failed | Check API limits and network connectivity |
| Poor translation quality | Some languages have better support than others |
| Slow translation | Translation API calls take 1-2 seconds |