rogerluan / strings-sweeper

A Swift script to determine and optionally remove unused localization keys in your project.

Repository from Github https://github.comrogerluan/strings-sweeperRepository from Github https://github.comrogerluan/strings-sweeper

Captura de ecrã 2023-12-06, às 01 18 19

A Swift script to determine and optionally remove unused localization keys in your project.

Description

  • Determines unused localization keys by scanning Swift files in the project.
  • Optionally removes unused keys from the specified language file.
  • Creates a backup of the original language file before removal.

Usage

Prerequisites

  • Swift installed on your machine.

Running the Script

  1. Open Terminal.
  2. Copy paste the script in your project
  3. Navigate to your project

Replace /path/to/your/Localizable.strings with the actual path to your Localizable.strings file.

The --remove flag is optional and will automatically remove unused keys from the file.

swift strings-sweeper.swift --lang /path/to/your/Localizable.strings --remove

swift strings-sweeper.swift --lang ./Localizable.strings --remove

strings-sweeper.mov

Options

--lang: Specify the path to the language file (default is ./Localizable.strings).

--remove: Automatically remove unused keys from the language file.

About

A Swift script to determine and optionally remove unused localization keys in your project.


Languages

Language:Swift 100.0%