Content-Type header of application/json.
Flat JSON
This format provides a direct mapping from string IDs to strings, without additional metadata. Example:?format=flat.
To fetch this via the CLI, specify format: flat in the config.yml file.
Structured JSON
This format maps string IDs to an object of each text item’s metadata. This format is recommended if metadata fields are used directly in development. Thetext field will always be included, with additional fields based on those included on the text item:
statusnotesvariablespluralsvariantsrich_text
?format=structured.
To fetch this via the CLI, specify format: structured in the config.yml file.
Nested JSON
Note: This format is only available when fetching components (not projects).
/ replacement character of . in the component ID settings, the JSON above would be generated from the following component IDs:
?format=nested.
To fetch this via the CLI, specify format: nested in the config.yml file.
ICU JSON
This format provides a mapping from string IDs to strings in accordance with the ICU message format. Example:- A Map or List variable in Ditto translates to an ICU SelectFormat argument, with the variable’s first value used as the “other” key.
- Single quotes (
') will be escaped with another single quote (i.e “You’re logged in” -> “You”re logged in”) - Pluralization in Ditto translates to an ICU PluralFormat argument:
- The PluralFormat, if present, will always encompass the rest of the string, within which variables can be nested.
- The name of the argument will always be
count(i.e.{count, plural, ...}) zero,one, andtwoplural forms are each output twice: once as an exact-value selector (=0,=1,=2) and once as the matching CLDR category keyword (zero,one,two), both mapped to the same text. This is intentional, not a duplicate to clean up — some locales (e.g. English) have nozerocategory at all, so without the=0selector that text would never display for a literal 0. Other locales’ categories cover more than the literal number (e.g. Russian’sonecategory also applies to 21, 31, 101, …), so the keyword selector is needed too.
?format=json_icu.
To fetch this via the CLI, specify framework: icu alongside format: json in the config.yml file. See Frameworks for more details.
ARB JSON
This format provides a mapping from string IDs to strings in the ARB (Application Resource Bundle) format, commonly used by Flutter’sintl package for localization.
Message text uses the same ICU message format syntax as ICU JSON above (variable interpolation, pluralization, and Map/List SelectFormat arguments all work identically). In addition:
- If a text item has notes, they’re included as a
descriptionfield in that item’s@-prefixed metadata entry, to give translators context. - If a text item has variables, they’re included as a
placeholdersfield in that item’s@-prefixed metadata entry, mapping each variable name to its ARB type (numfor number variables,Stringfor all other variable types). - If the export has a known base or variant locale, it’s included as a top-level
@@localekey.
?format=arb.
To fetch this via the CLI, specify framework: arb alongside format: json in the config.yml file. See Frameworks for more details.
Variant-specific exports
For each of these JSON formats, you can choose to fetch the text of a single variant. For flat, structured, nested, and ICU JSON, variant-specific exports also include two metadata keys for the variant:ARB exports don’t include
__variant-name/__variant-description. Unlike the other formats, ARB is consumed directly by third-party tooling (e.g. Flutter’s intl_utils/gen-l10n), which treats any non-@-prefixed top-level key as a translatable message — so these keys would leak into a generated app as fake strings. Use the variant’s locale, included as @@locale, to identify an ARB export’s variant instead.