How to properly delete stale or unused strings from .xcstrings files?

Over time, your project’s .xcstrings files may accumulate unused or outdated keys that can clutter the localization process and confuse translators. Cleaning them up keeps your String Catalog organized and efficient.

Best practices for removing unused strings:

  1. Check references in your code Before deleting any string, verify that it’s no longer used in your source code. Xcode’s “Find in Project” is a quick way to search for references.

  2. Use Xcode’s String Catalog editor

  • Open your .xcstrings file in Xcode.
  • Look for strings marked as unused (Xcode often flags these).
  • Remove them directly in the catalog to keep all language variants consistent.
  1. Delete carefully across all languages When you remove a key from the source language, make sure to also remove it from all other language entries in the catalog to avoid mismatches.

  2. Keep version control in mind Always commit your .xcstrings changes in Git (or another Version Control System - VCS) so you can easily revert if something breaks after cleanup.

With the xcstring integration in Localazy:

  • Keys deleted from your source file are detected automatically during upload.
  • Removing a string in your source .xcstrings ensures it’s also cleaned up across all target languages in Localazy. If the removed string — referred to as a deprecated key in Localazy terminology — later reappears in your source file during an upload, it is restored to the active state with all associated data (context, translations, contributors, etc.).
  • Translators see only the active, relevant strings, avoiding wasted effort on outdated content.

This way, your localization workflow stays clean, consistent, and free from unnecessary clutter.

Was this article helpful?

Please help us with improving our documentation.
We appreciate all your feedback.

Category

Last updated

02/10/2025