Find Duplicate Translation Keys Across Layers
find_duplicate_keysFind translation keys in both shared and app layers where the app value shadows the shared one. Compares a locale, reports divergent collisions, and identifies which side to delete.
Instructions
Find translation keys defined in BOTH a shared layer and an app layer that consumes it (e.g. the same key in a monorepo root layer and in app-shop). At runtime the app layer's value shadows the shared one — collisions with divergent values are the dangerous case, because the shared value silently never shows. Compares one reference locale and reports each collision with both values and a divergent flag. Fix by deleting one side, never by moving.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locale | No | Locale code to compare values in (e.g., "de", "en-US"). Defaults to the project default locale. | |
| byValue | No | When true, also groups different keys carrying the same value — e.g. common.actions.save and calendar.views.save both "Speichern". Each group says what to do about it: "reuse" (a shared layer already has it — delete the app copies and repoint call sites), "promote" (move one to a shared layer with move_translation_key), or "consolidate" (duplication inside one layer). Default: false. | |
| 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/duplicate-keys.json" | |
| projectDir | No | Absolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app". | |
| minValueLength | No | Shortest value worth grouping when byValue is set. Default: 4 — below it, values like "OK" repeat across unrelated namespaces legitimately. |