Skip to content

Latest commit

 

History

History
45 lines (26 loc) · 1.42 KB

README.md

File metadata and controls

45 lines (26 loc) · 1.42 KB

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.