Skip to main content

Developer Integrations

Updated over a week ago

Ditto’s developer integrations lets your engineers ship product quickly, safely, and with consistency are the core elements of operational scale. Here’s how Ditto can help:

  • Save work for developers: Say goodbye to the stray Slack message or bug ticket to update text (“Hey, can you update the text to actually say [XYZ]?”). Whether it’s in prod or in QA, Ditto reduces the time spent hunting down strings and gives time back to developers for real engineering work.

  • A single source of truth, accessible via API: Rather than multiple overlapping, disjointed sources for product text (Figma, a spreadsheet, a document, a localization tool, directly in development, etc.), Ditto connects sources so that everyone is on the same page. The latest version of text is always accessible directly via our API.

  • Building automated workflows: Use our CLI in a CI pipeline, build automation with our webhooks, or use our API to bring text to other destinations; Ditto’s developer integrations serve as building blocks.

  • Safety and formatting: With Ditto, developers get ready-to-use string files. Ditto handles all of the variable interpolation, pluralization, ID-naming, platform-specific formatting (JSON/ICU/iOS/Android), and localization-readiness.

💡 Go here to see Ditto’s dedicated developer hub


Developer IDs

Developer IDs in Ditto are unique, (typically) human-readable identifiers for various types of Ditto data, such as projects, text items, library components, component folders, variables, and variants. Developer IDs serve as the unique key for referencing each piece of Ditto data in development, as well as to retrieve desired data from the API and CLI.

Developer IDs are generated automatically when an item is created, based on that item’s data. Most items, such as projects and components, will have Developer IDs created based on their initial name, while text items’ will be generated based on their original text content.

To preserve stable references between Ditto and your application, once a Developer ID value has been generated, Ditto will not automatically update it when the related data changes. For instance, editing the content of a text item will not affect the text item’s Developer ID. However, you may directly edit the value of a Developer ID from within Ditto at any time.

⚠️ If you change the value of a Developer ID in Ditto, you will also need to update any references to that Developer ID in your own application. To avoid breaking changes, we recommend making any such edits before you begin using a given item in your code.

Project developer ID

To view and edit a project’s Developer ID, choose Development Integration in the main menu found in the top right of a project in the web app.

Text item and library component developer ID

  1. Select the text item in your project or the component in the library

  2. Edit the Developer ID section in the details panel

Library folder developer ID

  1. Visit the parent of a library folder (the folder that contains the one you want to view)

  2. Choose “Folder properties…” from the dropdown menu that appears on the folder in the left sidebar or the main content area

  3. Edit the Developer ID in the details panel

Variant developer ID

  1. Go to the variant library and select a variant

  2. Edit the Developer ID in the details panel


Uniqueness

In order to function as a suitable key for fetching Ditto data, Developer IDs for a given entity type must be unique within your workspace. No two projects or pieces of text may share a Developer ID (however you may have a project and a text item with the same value). Text items and library components belong to the same pool of Developer ID values; you may not have a library component and an unrelated text item with the same Developer ID, nor can similar text items in different projects share a value. With one exception: library components and their text item instances will all share the same Developer ID.

Example: I have a library component with Developer ID, “hello”. I create two text items in two different projects with the text “hello”. These text items will be assigned “hello-1” and “hello-2”. If I then attach both text items to the library component, all three text entities will now share the Developer ID, “hello”. Since text content and metadata is synced between these three text entities, they can safely share the same Developer ID — any data fetched by that ID should be identical across all instances.


Translation with Variants

Ditto generates localization-ready files using variants, with each variant corresponding to a language/locale. In these files, a single text item (string) can contain multiple variants, making it easy to display different language files to users. To handle localized strings, you can choose to either:

  • Localize in-house by providing translations in the Ditto app

  • Integrate Ditto with a translation management system (either using one of our existing integrations or via our API)

💡 To learn more about localizing with Ditto, check out this guide


Variable Interpolation

Variable interpolation and dynamic values are handled by variables in Ditto. When fetched by the API/CLI or in manual exports, Ditto will handle variable formatting specific to each string file format.

Did this answer your question?