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.

POSThttps://apibox.io.vn/v1/i18n-convert
Developer utilities▶ Try it online

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

NameInTypeRequiredDefault
contentbodystringyesThe translation file (text, multipart file or raw body). For diff: base.
actionbodystringnoconvertconvert, parse, diff or pseudo (alias op).
frombodystringnoautoInput format: json, json-nested, arb, xliff12, xliff20, po, strings, android, resx, yaml, csv.
tobodystringnoOutput format (same list).
localebodystringnoTarget locale written into the file (XLIFF, ARB, PO, YAML).
sourcebodystringnoSource-language file: real text for XLIFF <source> / PO msgid.
translationbodystringnodiff: one translation file; or translations { lang: file }.
downloadbodybooleannofalseReturn 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"}'

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

Start with 1,000 free requests every month. Get free API key →