Find Orphan Translation Keys
find_orphan_keysDetect unused translation keys in locale JSON files by scanning Vue/TS source code for references. Reports orphan keys that can be safely removed.
Instructions
Find translation keys that exist in locale JSON files but are not referenced in any Vue/TS source code. Scans a specific layer or all layers. Reports keys that can potentially be removed. Also detects dynamic key patterns and uncertain matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | Layer name to check for orphan keys (e.g., "root", "app-admin"). If omitted, checks all layers. Call discover to see available layers. | |
| locale | No | Locale code to read translation keys from (e.g., "en", "en-US"). Defaults to the project default locale. | |
| scanDirs | No | Absolute paths to directories to scan for source code usage. Defaults to all layer root directories. Example: ["/home/user/my-app/apps/admin"]. | |
| excludeDirs | No | Directory names to skip when scanning source files. Example: ["storybook", "__tests__", "node_modules"]. | |
| projectDir | No | Absolute path to the Nuxt project root. Defaults to server cwd. Example: "/home/user/my-app". | |
| outputFile | No | Absolute path to write full JSON output. Returns only a compact summary to the caller — use this for large outputs to avoid flooding the conversation context. Example: "/tmp/orphan-keys.json" |