Back to directory
JeevesInc avatar
JeevesInc / i18n-hunt

i18n-hunt

CLI to find unused i18n translation keys in JavaScript projects.

6

Stars

1

Forks

0

Watchers

License

i18n-hunt

Find unused i18n translation keys in JavaScript projects using AST analysis.

✨ Why this exists

Managing i18n keys gets messy fast.

As applications evolve, translation files tend to accumulate stale keys that are no longer referenced anywhere in the codebase.

i18n-hunt helps identify those unused translations before they become noise.

🚧 Status

Experimental (WIP)

The project is currently in an early stage and under active development.

The goal is to validate the approach, gather feedback, and evolve it into a stable CLI.

🚀 Installation

npm install @jeevesinc/i18n-hunt -D

⚙️ Usage

Create an i18n-hunt.toml file:

locales = "./public/locales/en-US"
src = "./src"

# Optional
src_exclude = ["**/*.test.ts", "legacy/**"]
locales_exclude = ["Legacy/**"]

Add a script to your package.json:

{
  "scripts": {
    "hunt": "i18n-hunt"
  }
}

Run the scan:

npm run hunt

You can also run it directly:

i18n-hunt --locales "public/locales/en-US" --src "src/"

🧠 Detection strategy

i18n-hunt analyzes your source code using AST analysis.

It classifies translation usage into:

  • Static keys → directly detected (t("form.email"))
  • Prefixes → partially dynamic but still safe (t(form.${field}))
  • Dynamic usage → tracked without aggressively marking keys as unused

This helps reduce false positives while still surfacing genuinely unused translations.

For supported patterns and detection details, see the Wiki.

🤝 Contributing

Contributions and feedback are welcome — especially at this stage.

Useful contributions include:

  • Reporting false positives or false negatives
  • Sharing real-world edge cases
  • Improving CLI UX
  • Suggesting workflow or config improvements

Releases

v0.1.0-alpha.1

Pre-release

May 14, 2026

Download .zip

First public alpha release of i18n-hunt. The project is still evolving and focused on validating the core workflow and detection engine. Expect rough edges, missing patterns, and improvements in futur...