To quickly integrate strings from your codebase into Ditto, you can use our string file import feature to create components in your component library.

The following formats are accepted: JSON (.json), Android XML (.xml), iOS Strings (.strings). (If you're looking to import from CSV, check out this guide instead.)

Using our codebase file import, you'll be able to:


Basics

To import a file into Ditto, head to the Component Library and click the "+ New Component" button at the top right. Select the "Import string files" option.

JSON (.json)

We currently support 3 JSON formats: flatnested, and structured. In each of the three formats, the component's name will be generated from the keys used in the JSON.

Notably, the default format that is selected when exporting from the component library — Full Component Library JSON ****— is not supported as an import format.

Flat JSON

Example:

{
	"mobile.onboarding.header":"Welcome!",
	"mobile.onboarding.cta": "Sign Up",
	"mobile.disclaimer": "Return to sender"
}

Resulting components:

In the flat format, any periods (.) in the key name will be converted into forward slashes (/) in the component name to organize components in the component library. The component's API ID will remain the same as the key.

Nested JSON

Example: