Translation Service
Translate content across multiple languages with YODI's translation API.
Endpoint​
POST https://admin.yodi.tg/api/ai/translate
Description​
Translate text to any supported language with high accuracy and speed.
Parameters​
Required​
| Parameter | Type | Description |
|---|---|---|
text | string | Text to translate |
targetLanguage | string | Target language code (e.g., 'fr', 'ewe', 'mina') |
Optional​
| Parameter | Type | Default | Description |
|---|---|---|---|
sourceLanguage | string | auto-detect | Source language code |
formality | string | neutral | Formality level: 'formal', 'neutral', 'informal' |
Example Request​
curl -X POST "https://admin.yodi.tg/api/ai/translate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Bonjour, comment allez-vous?",
"sourceLanguage": "fr",
"targetLanguage": "ewe",
"formality": "neutral"
}'
Example Response​
{
"message": "SUCCESS",
"error": false,
"data": {
"translatedText": "Akɔtaba me, ɔlɔ ɖe?",
"sourceLanguage": "fr",
"targetLanguage": "ewe"
},
"status": 200
}
Supported Languages​
YODI supports translation for African languages with special focus on West African languages.
| Code | Language |
|---|---|
| mina | Mina |
| fr | French (Français) |
| ewe | Ewe |
| tem | Tem (Kotokoli) |
Use these language codes for targetLanguage and sourceLanguage in translation requests.
Use Cases​
- Localize mobile apps
- Translate web content
- Auto-translate customer emails
- Subtitle generation
- Document translation