Setting what text and formats the CLI pulls down
config.yml
file is the source of truth for a given directory about how the CLI should fetch and store data from Ditto based on the specified properties. It includes information about which Ditto components the CLI should pull text from, the string file formats, and more.
This is the default configuration file that is generated the first time that the CLI is run in a given directory:
sources
components
or projects
) is required.
sources.components
root
and folders
.
root
controls behavior for components that are NOT in folders (i.e. that are at the root of the component library)folders
controls behavior for components that are ARE in foldersOnly components not in folders
root
is true
and folders
is unspecified, only components not in folders will be fetched:Only components in folders
root
is false
and folders
is unspecified, only components in any folder will be fetched:Only components in specified folders
root
is unspecified and folders
contains a list of component folders, only components in the specified folders will be fetched:Only components in specified folders and not in a folder
root
is true
and folders
contains a list of component folders, non-folder components and components in the specified folders will be fetched:Only components not in folders with a given status
root
can also be specified as a configuration object with a status
property to indicate that non-folder components should be fetched that have the indicated status:sources.projects
name
property is used for display purposes when referencing a project in the CLI, but does not have to be an exact match with the project name in Ditto.exclude_components
property can be added on a per-project basis to indicate that text items should only be pulled which are not associated with a component:
variants
false
if not specified.
format
structured
flat
nested
android
ios-strings
ios-stringsdict
flat
if not specified.
status
NONE
WIP
REVIEW
FINAL
status
is specified at the top level of the configuration, it will apply to all sources:
status
can also be specified at the level of individual sources:
status
overrides a top-level status
.
More information about Ditto statuses can be found here.
richText
flat
format, output values will be HTML strings (rich text) for each piece of source data.
If defined with the structured
format, output data will include a rich_text
property that is an HTML string (rich text) for each piece of source data.
You can read more about Ditto’s rich text feature here.
iosLocales
ios-strings
or ios-stringsdict
formats.
When this property is defined, iOS string files written to disk by the CLI are grouped into lproj
localization bundles, and a Ditto.swift
driver file is generated.
base
property is required, and should map to the locale ID corresponding to the default language of your iOS project.
See iOS format-specific files for more information.
disableJsDriver
index.js
and index.d.ts
driver files when working with JSON formats.