Move Translation Key Between Layers
move_translation_keyMove a translation key between layers, preserving all locale values. Promote an app key to a shared layer or demote a shared key that became app-specific. Skips on conflict; dryRun previews.
Instructions
Move a key from one layer to another, carrying every locale that defines it — promoting an app-layer key to a shared layer once a second app needs it, or demoting a shared key that turned out to be app-specific. Call discover first: layerGraph.shared names the layers more than one app consumes. Writes nothing at all if the target layer already holds the key with a different value in any locale; if it holds the same value, that locale is deduplicated instead. Use dryRun to preview the plan.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Dot-separated key path to move. Example: "calendar.views.save". | |
| dryRun | No | When true, returns the plan without writing any files. Default: false. | |
| newKey | No | Key path in the target layer, when the move also renames it. Example: "common.actions.save". Defaults to the same path. | |
| toLayer | Yes | Layer to move it to, from discover. Example: "root". Must differ from fromLayer — to rename within one layer, use rename_translation_key. | |
| fromLayer | Yes | Layer the key lives in today, from discover. Example: "app-admin". | |
| projectDir | No | Absolute path to the project root. Defaults to I18N_PROJECT_DIR, then server cwd. |