---
description: "Toggle outputLanguage (assistant explanations, picker questions, PR/Jira/Confluence bodies). promptLanguage is fixed to English; commit messages, branch names and identifiers stay English. Use when the assistant should explain itself in a different language."
description-tr: "outputLanguage'i değiştirir (asistan açıklamaları). promptLanguage İngilizce sabittir. Dış payload'lar İngilizce kalır."
argument-hint: "[en|tr]  -  sets outputLanguage; omit for interactive picker; use 'output en|tr' for explicit form"
---

# multi-agent language  -  Language Preference Toggle

**Input**: $ARGUMENTS

Two-axis language preference for the pipeline:

| Field | Controls | Stored at | Mutability |
|---|---|---|---|
| `promptLanguage` | Interactive prompts during a pipeline run (account picker, project picker, dev-context picker, base-branch picker, branch-name picker, maturity ack, channels picker, Phase 5 test prompt, Phase 6 local-checkout prompt) | `prefs.global.promptLanguage` | **Fixed to `en`**  -  never toggled by this skill |
| `outputLanguage` | Assistant's explanations, status updates, error messages, and pipeline-generated reports rendered to the user (NOT external payloads) | `prefs.global.outputLanguage` | Toggled by this skill |

**Why promptLanguage is fixed:** it governs the picker's structural chrome only  -  `AskUserQuestion` `label` (button text) and `header` (chip), host error UI, and internal contract identifiers. Those stay English so tooling reads the same across CLIs. Everything a user actually reads follows `outputLanguage`, including the picker `question` and each option's `description`, per the canonical per-field matrix in `multi-agent-refs/rules.md`. A picker whose question is English on a Turkish run is a bug, not the contract.

**Always English regardless of either field**: commit messages, PR titles/bodies, Jira comments, wiki pages, reviewer/triage system prompts, agent-log.md payloads, confirmation / error UI exposed by the CLI host.

**Follows outputLanguage (localized at install/toggle time)**: the slash-command picker `description` shown by the CLI host autocomplete. Repo and npm files always keep the English `description:`; files shipping a `description-tr:` line get swapped in the INSTALLED `~/.claude/commands/multi-agent/` tree by `localize-commands.mjs` (reversible via a `description-en:` sidecar). `/multi-agent:sync` restores English before mirroring back to the repo.

## Invocations

| Form | Behavior |
|---|---|
| `/multi-agent:language` | Interactive: shows current outputLanguage, prompts for a new value via AskUserQuestion. |
| `/multi-agent:language en` or `/multi-agent:language tr` | Sets `outputLanguage` to the given value. `promptLanguage` is left untouched (always `en`). |
| `/multi-agent:language output en\|tr` | Same as the single-token form  -  sets only `outputLanguage`. |
| `/multi-agent:language prompt ...` | **Rejected.** Print: `promptLanguage is fixed to "en" and cannot be changed.` |

## Steps

### Read current state

```bash
PREFS="$HOME/.claude/multi-agent-preferences.json"
OUTPUT_LANG=$(jq -r '.global.outputLanguage // "<unset>"' "$PREFS" 2>/dev/null || echo "<unset>")
```

`promptLanguage` is intentionally NOT read  -  it is a fixed `en` and not a knob this skill exposes.

### Branch on argument shape

1. **No argument** → interactive picker:
   - Show current value (English UI per skill-prompt rules):
     ```
     Current outputLanguage: <value>
     (promptLanguage is fixed to "en"  -  not configurable)
     ```
   - AskUserQuestion: "Update outputLanguage?" → `en` / `tr` / keep
   - Apply via the writer below.

2. **Single token (`en` | `tr`)** → set `outputLanguage` to that value. Do NOT touch `promptLanguage`.

3. **Two tokens starting with `output` (`output en|tr`)** → equivalent to the single-token form.

4. **Two tokens starting with `prompt`** → reject: print `promptLanguage is fixed to "en" and cannot be changed.` and exit non-zero.

5. **Anything else** → print usage and exit non-zero.

### Self-heal promptLanguage

If `prefs.global.promptLanguage` is not `"en"`, this skill MUST repair it back to `"en"` as part of every successful invocation. This protects against legacy preferences from earlier skill versions that allowed Turkish prompts.

### Writer

Validate value is in `["en", "tr"]`, then atomic write  -  and always force `promptLanguage = "en"`:

```bash
TMP=$(mktemp)
jq --arg ol "$NEW_OUTPUT" '
  .global.promptLanguage = "en"
  | .global.outputLanguage = (if $ol == "" then .global.outputLanguage else $ol end)
' "$PREFS" > "$TMP" && mv "$TMP" "$PREFS"
```

### Localize picker descriptions

After a successful write, swap the installed command descriptions to match the
new outputLanguage (repo files are never touched; the swap is reversible):

```bash
if [ "$NEW_OUTPUT" = "tr" ]; then
  node "$HOME/.claude/scripts/localize-commands.mjs" apply
else
  node "$HOME/.claude/scripts/localize-commands.mjs" restore
fi
```

Note: the CLI host caches the picker list per session; descriptions refresh on
the next session start.

### Confirmation echo

Render in the **new** outputLanguage:

- `en`: `outputLanguage=<Y>. promptLanguage stays "en". External payloads remain English.`
- `tr`: `outputLanguage=<Y>. promptLanguage "en" sabit. Dış çıktılar İngilizce kalır.`

## Validation

- Reject any value that is not `en` or `tr`. Print: `Invalid language. Use "en" or "tr".`
- If `$PREFS` does not exist, instruct the user to run `/multi-agent:setup` first.
- If `jq` is missing, fall back to direct file write only when both values are provided as args (skip interactive mode).

## Cross-reference

- `setup.md` Step 0  -  first-run language picker (asks only outputLanguage; promptLanguage seeded as `en`)
- `prefs.schema.json`  -  `global.promptLanguage` (fixed `"en"`) and `global.outputLanguage` definitions
- `phase-5-test.md`, `phase-6-commit.md`  -  interactive prompts follow the per-field matrix: `question` + `description` in `outputLanguage`, `label` + `header` English
- `help.md`  -  reads outputLanguage to render its own help text
