<- Back to all posts

Managing String IDs in Development

Jessica Ouyang
|
January 25, 2023

In many teams’ existing developer workflows, developers work within their own set of existing constraints, conventions, and automations. As teams have ramped up their usage of Ditto components and developer integrations, we want to make sure that Ditto integrates as seamlessly into developer workflows as possible.

For a lot of developers that manage their product’s strings, it’s their responsibility to name and maintain the keys or IDs of their strings when decoupled into a string file format, whether it’s a JSON, Android XML, or iOS Strings. For a lot of teams, prior to using Ditto, this ID is likely manually named by an engineer, whether the ID is a random set of characters, a variable name, or a version of the string itself.

In Ditto, engineers don’t have to worry at all about manually naming strings themselves — Ditto takes care of generating and managing all IDs. Today, we’re excited to introduce the ability to configure exactly how those developer IDs get auto-generated in your workspace. As teams scale up their Ditto coverage and integrate Ditto to handle all of the text in their product from design to development, we want to make sure that how IDs get generated and maintained in Ditto is a robust and configurable process.

How does this work?

From your developer integrations page, you'll now be able to configure the rules around how developer IDs get generated. On this page, it’ll display the current rules your workspace has in place.

These configurations allow you to customize the rules around how developer IDs get generated for both the component library and text items in projects.

Component ID Settings

When you click “Edit” for the Component ID rules, you’ll be able to configure rules for how developer IDs get generated for components. This includes the ability to specify:

  • Delimiters
  • Casing (i.e. camel case, pascal case, all caps, etc.)
  • Accepted characters (via regex)

The modal also allows for the rules to be tested on a sample component name, as well as the option to regenerate all existing IDs based on updated rules.

If someone in your workspace makes edits to the workspace ID configurations, the activity itself will display in your component library.

Text Item ID Settings

These settings allow you to configure the generation of text items in projects not currently attached to components. This includes the ability to specify: 

  • Properties (forming a template) used to generate the ID, including project name, group name, block name, and text itself
  • Casing (i.e. camel case, pascal case, all caps, etc.)
  • Accepted characters (via regex)
  • Maximum ID length

To learn more about managing IDs in Ditto, check out this help guide.

Key Benefits

With these new configurations, we hope it saves teams’ time, especially as they rapidly add to their component libraries. We hope it reduces overhead by allowing teams to:

  • Normalize / align with existing developer-side ID conventions — For teams already managing their strings in string files prior to using Ditto, the configuration options allow teams to align IDs in Ditto with existing patterns so that no additional manual work is needed to normalize the IDs of new components created in Ditto.
  • Utilize naming patterns and organization of the component library — With many teams fleshing out the organization of their component libraries, utilizing our folders and 3 levels of nesting, configured component ID rules allows teams to take advantage of the work already put into organizing and naming components.

We’re excited for you all to give it a try! If you have any additional configurations you’d like for your teams developer settings, please let us know.


Edit (3/7/2023): This post is updated to now include information about rules for developer IDs for text items in projects, which we have just released! 🎉

Success! 🥳 Look forward to Ditto updates in your inbox.
Oh no — something went wrong while submitting the form. Please try again!