1.0.7 • Published 10 months ago

translation-key-purge v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Translation Key Purge

A tool to automatically detect and remove unused translation keys from i18n files across multiple projects, helping maintain clean and efficient localization in React.js and Next.js.

Features

  • Detect unused translation keys in your project.
  • Remove unused translation keys from JSON files.
  • Supports React.js and Next.js projects.

Installation

You can install the package using npm:

npm install translation-key-purge

Or using yarn:

yarn add translation-key-purge

Configuration

Create a sumit.config.json file in the root of your project to customize the behavior of the package.

{
  "functionName": "t",
  "languageCode": "en",
  "searchPath": "src"
}
  • functionName: The function name used for translation keys in your code (default: t).

  • languageCode: The language code for the JSON file to check (default: en).

  • searchPath: The searchPath for the JSON file source folder path to check (default: src).

Usage

  1. Create a sumit.config.json file in the root of your project with the desired configuration.

  2. Add the following script to your package.json:

"scripts": {
  "check-keys": "translation-key-purge start"
}
  1. Run the script in your terminal:
npm run check-keys
  1. Follow the prompts to remove unused translation keys.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Sumit Mayani

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago