<- Back to all posts

How to manage strings across multiple platforms

Jessica Ouyang
|
November 30, 2022

When developing applications, it can quickly become tricky to manage strings across multiple platforms — web, Android, iOS, and more. Although the strings across across the various platforms are often the same, each platform requires different string file formats, each with format-specific requirements on handling everything from line breaks and variables to plurals and key naming.

When done manually, maintaining an application across multiple platforms becomes exponentially more time-consuming with each new file format and locale — even to fix something as simple as a typo. Editing a single string can end up taking hours of time across multiple people: A writer or designer would first have to provide the updated copy, create a ticket, and advocate for the ticket to land on the sprint. Once the ticket gets picked up, engineers from each of the different platforms have to track down where the string is located in their respective platform and update the string in the corresponding file format appropriately.

Using Ditto, teams can manage and edit their product text in one place (such as in our web-app or directly in a Figma file) and automatically generate production- and localization-ready string files across multiple formats, from iOS .strings to Android .xml. This means developers just have to fetch the latest text directly into development, and no one has to manually edit string files.

How does this work?

Ditto always stores and maintains the latest version of product copy. You can import and link text from Figma files, or you can draft text directly in Ditto. In addition to syncing the latest edits from Figma files, you can also use Ditto to componentize text for reuse, mark text status, maintain different versions or locales, and track edit history.

For the latest text to be reflected in development, developers just need to use our API or CLI (i.e. running ditto-cli pull). The API/CLI would then return the up-to-date text in all file formats necessary (from JSON to mobile formats) — including localization-ready formats. As a note, the Ditto CLI mirrors the API’s functionality but allows developers to fetch directly from the command line to save files locally.

The up-to-date string files are saved locally and can be deployed to staging or production when ready. This means developers can use a single command to fetch any text edits or new strings, and no one has to create or edit string files manually. Teams can also automate the fetching of text in their CI/CD pipeline. Edits can be viewed via the text diffs directly when opening a pull request.

For example, if you have the following Figma mockup of a screen that’s linked to Ditto, a developer can easily fetch the strings in the screen in all formats:

Core benefits

1. Reduction in developer time. An obvious benefit to using a managed source like Ditto to handle your applications strings is time saved for developers. This includes saving time previously spent by developers:

  • Making text edits to strings in each format
  • Naming and maintaining text keys — in Ditto, keys are automatically generated and can be edited/managed through the web-app, rather than manually named in each different file format
  • Searching for text strings — with Ditto, developers can click on strings directly in the Figma mockup to view their keys, as well as search for text by their keys in the web-app
  • Going back and forth with designers/writers on the intended copy

2. Fewer errors entering production. With the API handling the formatting of the files themselves, developers no longer have to manually ensure the up-to-date text is formatted correctly in each application-specific format. This includes handling:

  • Pluralizations
  • Interpolating Variables
  • Line breaks
  • Special characters

3. Faster iteration for writers/designers. Because writers and designers no longer have to go back-and-forth with developers to make edits to copy, they can more quickly test out new copy or roll out improvements. This includes patch fixes for typos, updating links, building out new features, or A/B testing content.

4. Faster expansion into additional platforms. When expanding into additional platforms, teams no longer have to consider the overhead of maintaining the strings in an additional format. As they’re managed by the same source, maintaining strings for 1 format is the same amount of work as doing it for 3.

Try it out!

It shouldn’t take more than a few minutes to fetch text in Ditto in multiple formats — whether iOS strings or Android XML. All you have to do is:

1. Enable Developer Mode for the text you’d like to fetch — whether it’s a project or the component library.

2. Fetch the formatted text in one of three ways:

  • Fetch using our API and specify the format by providing the format query parameter.
  • Fetch using our CLI and specify the format in the config.yml.
  • Fetch manually by using our in-app export and selecting the format via the dropdown.

If you want to see exactly how Ditto can be integrated into iOS and Android apps, check out our example projects! Bonus: these demo projects also include localization. 😎

divider

We’re always working to improve our developer integrations. Are there other formats you want to see? Let us know!

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