ARB
ARB is a JSON-based format used primarily for Flutter internationalization and similar workflows.
If you use Flutter, please check out our dedicated Flutter guide for a complete setup.
Features
- Preservation of comments and formatting.
descriptionandcontext/x-meaningare used as context when provided.- Images are ignored (
type: image).
Usage
curl --fail-with-body --silent --show-error --compressed https://api.doloc.io -H "Authorization: Bearer $API_TOKEN" -F source="@source.arb" -F target="@target.arb" -o result.arbYou need to provide the source texts as the first file and the target texts as the second file.
Make sure the files are named with the .arb extension, so that the format can be correctly identified.
The above command includes production-ready options. For details on the curl flags, see Curl Command Details.
Example
For a detailed example of ARB localization with doloc, including step-by-step instructions on using the API for translation, check out our ARB Example Translated with doloc.
Options
Options are passed as query parameters in the URL.
For details check the options documentation.
| name | values | default | description |
|---|---|---|---|
sourceLang | any IETF BCP 47 language tag such as en-US, de-DE, etc. | inferred from @@locale-attribute (if present), otherwise from filename - e.g. messages_fr.arb infers fr. Fallback to en. | This specifies the language of the source texts. |
targetLang | any IETF BCP 47 language tag such as en-US, de-DE, etc. | inferred from @@locale-attribute (if present), otherwise from filename - e.g. translations.en-us.arb infers en-us. | This specifies the language of the target texts. |
untranslated | combination of missing, empty, equal. | missing | Translate all units that match this configuration. missing: not contained in target file. empty: has empty value in target file. equal: has the same value in source and target file. |
Limitations
none that we are aware of 🙂
Please reach out, if you need support for these or other formats! 🚀