POST /translator/translate/env

Translate ENV

Translate .env file values while preserving keys, comments, and structure.

Translation API

Translate .env file content while preserving all keys, comments, and structure. Only the values are translated, keeping your environment variable names and formatting intact. Useful for localizing configuration files and environment templates.

HTTP Request

1
POST /translator/translate/env

Parameters

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

Request Body

Send the .env content as the raw request body with Content-Type: text/plain.

1
2
3
4
5
6
7
# Application Settings
APP_NAME=My Application
APP_DESCRIPTION=A powerful tool for managing your daily tasks
WELCOME_MESSAGE=Welcome to our platform
ERROR_NOT_FOUND=The page you are looking for does not exist
ERROR_UNAUTHORIZED=You do not have permission to access this resource
FOOTER_TEXT=Copyright 2025. All rights reserved.

Response

1
2
3
4
5
6
7
8
{
  "status": true,
  "data": {
    "translated_env": "# Application Settings\nAPP_NAME=Mi Aplicacion\nAPP_DESCRIPTION=Una herramienta poderosa para gestionar tus tareas diarias\nWELCOME_MESSAGE=Bienvenido a nuestra plataforma\nERROR_NOT_FOUND=La pagina que buscas no existe\nERROR_UNAUTHORIZED=No tienes permiso para acceder a este recurso\nFOOTER_TEXT=Copyright 2025. Todos los derechos reservados.",
    "source_language": "en",
    "source_language_name": "English"
  }
}

Response Fields

FieldTypeDescription
statusbooleanWhether the request was successful
data.translated_envstringThe translated ENV content with keys 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
29
import requests

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

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

payload = """# Application Settings
APP_NAME=My Application
APP_DESCRIPTION=A powerful tool for managing your daily tasks
WELCOME_MESSAGE=Welcome to our platform
ERROR_NOT_FOUND=The page you are looking for does not exist"""

headers = {
    "Content-Type": "text/plain",
    "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 env file
with open(".env.es", "w", encoding="utf-8") as f:
    f.write(data["data"]["translated_env"])

print("ENV 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
const url = "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/env";

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

const env = `# Application Settings
APP_NAME=My Application
APP_DESCRIPTION=A powerful tool for managing your daily tasks
WELCOME_MESSAGE=Welcome to our platform
ERROR_NOT_FOUND=The page you are looking for does not exist`;

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

const data = await response.json();
console.log(data.data.translated_env);
1
2
3
4
5
6
7
curl -X POST "https://multi-format-ai-translator-the-most-complete.p.rapidapi.com/translator/translate/env?source=auto&target=es" \
  -H "Content-Type: text/plain" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: multi-format-ai-translator-the-most-complete.p.rapidapi.com" \
  -d 'APP_NAME=My Application
APP_DESCRIPTION=A powerful tool for managing your daily tasks
WELCOME_MESSAGE=Welcome to our platform'
Start building today

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

Get Your API Key on RapidAPI