POST /translator/translate/arb

Translate ARB

Translate ARB (Application Resource Bundle) localization files for Flutter and Dart applications.

Translation API

Translate ARB (Application Resource Bundle) JSON localization files while preserving keys, metadata entries, and ICU message syntax placeholders. Only the string values are translated, keeping your @-prefixed metadata keys and {placeholder} tokens intact. The standard localization format for Flutter and Dart applications.

HTTP Request

1
POST /translator/translate/arb

Parameters

ParameterTypeRequiredDefaultDescription
sourcestringNo"auto"Source language code. Use auto for automatic detection
targetstringYesTarget language code

Request Body

Send the ARB JSON content as the raw request body with Content-Type: application/json.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  "@@locale": "en",
  "appTitle": "My Application",
  "@appTitle": {
    "description": "The title of the application"
  },
  "welcomeMessage": "Welcome, {userName}!",
  "@welcomeMessage": {
    "description": "Welcome message with user name",
    "placeholders": {
      "userName": {
        "type": "String",
        "example": "John"
      }
    }
  },
  "itemCount": "{count, plural, =0{No items} =1{1 item} other{{count} items}}",
  "@itemCount": {
    "description": "Item count with pluralization"
  },
  "loginButton": "Sign In",
  "logoutButton": "Sign Out",
  "settingsTitle": "Settings",
  "errorGeneric": "Something went wrong. Please try again."
}

Response

1
2
3
4
5
6
7
8
{
  "status": true,
  "data": {
    "translated_arb": "{\"@@locale\":\"es\",\"appTitle\":\"Mi Aplicacion\",\"@appTitle\":{\"description\":\"The title of the application\"},\"welcomeMessage\":\"Bienvenido, {userName}!\",\"@welcomeMessage\":{\"description\":\"Welcome message with user name\",\"placeholders\":{\"userName\":{\"type\":\"String\",\"example\":\"John\"}}},\"itemCount\":\"{count, plural, =0{Sin elementos} =1{1 elemento} other{{count} elementos}}\",\"@itemCount\":{\"description\":\"Item count with pluralization\"},\"loginButton\":\"Iniciar Sesion\",\"logoutButton\":\"Cerrar Sesion\",\"settingsTitle\":\"Configuracion\",\"errorGeneric\":\"Algo salio mal. Por favor intenta de nuevo.\"}",
    "source_language": "en",
    "source_language_name": "English"
  }
}

Response Fields

FieldTypeDescription
statusbooleanWhether the request was successful
data.translated_arbstringThe translated ARB JSON content with keys and metadata preserved
data.source_languagestringDetected or specified source language code
data.source_language_namestringHuman-readable name of the source language

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import requests
import json

url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/arb"

querystring = {
    "source": "en",
    "target": "es"
}

# Read the ARB file
with open("lib/l10n/app_en.arb", "r", encoding="utf-8") as f:
    payload = f.read()

headers = {
    "Content-Type": "application/json",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "multi-format-ai-translator-the-most-complete.p.rapidapi.com"
}

response = requests.post(url, headers=headers, params=querystring, data=payload)
data = response.json()

# Save the translated ARB file
with open("lib/l10n/app_es.arb", "w", encoding="utf-8") as f:
    f.write(data["data"]["translated_arb"])

print("ARB file translated and saved.")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/arb";

const params = new URLSearchParams({
  source: "en",
  target: "es",
});

const arb = JSON.stringify({
  "@@locale": "en",
  appTitle: "My Application",
  "@appTitle": { description: "The title of the application" },
  welcomeMessage: "Welcome, {userName}!",
  "@welcomeMessage": {
    description: "Welcome message with user name",
    placeholders: { userName: { type: "String", example: "John" } },
  },
  loginButton: "Sign In",
  logoutButton: "Sign Out",
  settingsTitle: "Settings",
});

const response = await fetch(`${url}?${params}`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "multi-format-ai-translator-the-most-complete.p.rapidapi.com",
  },
  body: arb,
});

const data = await response.json();
console.log(data.data.translated_arb);
1
2
3
4
5
curl -X POST "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/arb?source=en&target=es" \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: multi-format-ai-translator-the-most-complete.p.rapidapi.com" \
  -d '{"@@locale":"en","appTitle":"My Application","@appTitle":{"description":"The title of the application"},"welcomeMessage":"Welcome, {userName}!","loginButton":"Sign In","logoutButton":"Sign Out"}'
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI