CLI Commands
orphans
Report translation keys that no source code references. Nothing is deleted unless remove is set.
Synopsis
the-i18n-cli orphans
Flags
| Flag | Type | Required | Default | Description |
|---|---|---|---|---|
--layer | string | no | — | Layer name to scope this to (e.g., "root", "app-admin"). If omitted, every layer is included. Call discover to list the layers. |
--locale | string | no | — | Locale code to read the translation keys from (e.g., "en", "en-US"). Defaults to the project default locale. |
--remove | boolean | no | false | Permanently delete the orphan keys from every locale file of their layer. Default: false, which only reports them — run without it first and read the findings. Uncertain keys and misplaced usages are never deleted. |
--usages | boolean | no | false | Report where keys are referenced in source (file paths and line numbers) instead of which keys are unreferenced. |
--keys | string | no | — | Keys to report usages for. Only read together with usages; without it, every key is considered. Comma-separated. |
--outputFile | string | no | — | Absolute path to write the full JSON output to. Only a compact summary is returned to the caller, which is what you want for a result too large to read in one piece. Example: ".i18n-reports/orphan-keys.json" |
--codequalityOutput | string | no | — | Also write the orphan findings as a GitLab Code Quality (CodeClimate) JSON report to this file path. |
--failOnOrphans | boolean | no | false | Exit 2 when any orphan key is found (CI gate). |