Translation File Converter (i18n) API
Convert translation files between JSON, XLIFF 1.2 / 2.0, PO, ARB, iOS .strings, Android XML, .resx, YAML, CSV; find missing keys; pseudo-locales.
Read and write the common localisation formats through one model (key, value, plural forms, note, context, source text): JSON flat or nested (i18next, vue-i18n, with _one / _other plural suffixes), ARB (Flutter, @key descriptions, ICU plurals), XLIFF 1.2 and 2.0 (inline tags kept), gettext PO / POT (context, plurals, translator comments), iOS .strings, Android strings.xml (string, plurals, string-array, escapes), .NET .resx, Rails YAML and CSV for translators. from is detected from the content; set to and the target locale.
action=diff compares a base file with one translation or several translations ({ "vi": …, "ja": … }) and lists missing, extra, untranslated and unchanged keys, placeholder mismatches ({name}, {{name}}, %s, %1$d, %{name}, ${name}, ICU arguments), HTML tag mismatches and ICU MessageFormat syntax errors (e.g. a plural without other), with a coverage percentage. action=pseudo makes a pseudo-locale (accented, ~35 % longer, bracketed, placeholders and tags untouched) to find hard-coded strings and truncation. action=parse returns the entries.
Pass source (the source-language file) to fill XLIFF <source> and PO msgid with real text. download=true returns the file itself. Up to 5 MB and 50,000 keys.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
content | body | string | yes | The translation file (text, multipart file or raw body). For diff: base. | |
action | body | string | no | convert | convert, parse, diff or pseudo (alias op). |
from | body | string | no | auto | Input format: json, json-nested, arb, xliff12, xliff20, po, strings, android, resx, yaml, csv. |
to | body | string | no | Output format (same list). | |
locale | body | string | no | Target locale written into the file (XLIFF, ARB, PO, YAML). | |
source | body | string | no | Source-language file: real text for XLIFF <source> / PO msgid. | |
translation | body | string | no | diff: one translation file; or translations { lang: file }. | |
download | body | boolean | no | false | Return the converted file instead of JSON. |
Example
curl -X POST "https://apibox.io.vn/v1/i18n-convert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"{\"home\":{\"title\":\"Welcome, {{name}}!\",\"items_one\":\"{{count}} item\",\"items_other\":\"{{count}} items\"}}","to":"po","locale":"vi"}'const res = await fetch('https://apibox.io.vn/v1/i18n-convert', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"content": "{\"home\":{\"title\":\"Welcome, {{name}}!\",\"items_one\":\"{{count}} item\",\"items_other\":\"{{count}} items\"}}",
"to": "po",
"locale": "vi"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/i18n-convert",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"content": "{\"home\":{\"title\":\"Welcome, {{name}}!\",\"items_one\":\"{{count}} item\",\"items_other\":\"{{count}} items\"}}", "to": "po", "locale": "vi"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/i18n-convert');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"content":"{\\"home\\":{\\"title\\":\\"Welcome, {{name}}!\\",\\"items_one\\":\\"{{count}} item\\",\\"items_other\\":\\"{{count}} items\\"}}","to":"po","locale":"vi"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"from": "json-nested",
"to": "po",
"locale": "vi",
"count": 2,
"warnings": [],
"output": "msgid \"\"\nmsgstr \"\"\n\"Content-Type: text/plain; charset=UTF-8\\n\"\n\"Language: vi\\n\"\n\"MIME-Version: 1.0\\n\"\n\"Content-Transfer-Encoding: 8bit\\n\"\n\n#: home.title\nmsgid \"home.title\"\nmsgstr \"Welcome, {{name}}!\"\n\n#: home.items\nmsgid \"home.items\"\nmsgid_plural \"home.items\"\nmsgstr[0] \"{{count}} item\"\nmsgstr[1] \"{{count}} items\"\n"
}
Use cases
- Send app strings to translators as XLIFF or CSV and import them back
- Move a React i18next project to Flutter ARB or Android strings.xml
- Check in CI that every language has all keys and matching placeholders
- Generate a pseudo-locale to test UI truncation before real translation
FAQ
Are plurals converted?
Yes: i18next suffixes, Android plurals, PO msgstr[n], Rails one / other and ICU plural messages map onto each other. Formats without plurals (.strings, .resx) get the ICU text and a warning.
What does the PO msgid contain?
The source text when you pass source (or the file already has it), otherwise the key. msgctxt is kept.
Is .mo supported?
No, send the .po source. Compiled .mo files are refused with a clear error.
Related APIs
UUID Generator
Generate up to 1,000 UUID v4, time-ordered UUID v7, ULID, Nano ID or random hex IDs per request. Secure randomness, optional uppercase.
⏱Cron Expression Parser
Validate a cron expression and get its next run times in any timezone, with a plain-English description. Supports 5, 6 and 7-field cron syntax.
🕒Time & Timezone Converter
Get the current time in any timezone, convert between timezones and Unix timestamps (seconds or ms), with UTC offset and weekday for up to 30 zones.