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:
status
notes
variables
plurals
variants
rich_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, ...}
)
?format=icu
.
To fetch this via the CLI, specify format: icu
in the config.yml
file.