format_catalogs
Cleans, sorts, and aligns JSON or ARB translation catalogs alphabetically or by source-locale key order to prevent merge conflicts and inconsistent formatting. Preview changes as diffs with a dry run before writing files.
Instructions
Cleans, sorts, and formats translation catalogs (JSON and ARB) alphabetically or aligned with source locale key ordering, eliminating merge conflicts and inconsistent formatting.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "format_catalogs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | If true, previews changes via unified diffs without modifying files. If false, writes formatted files to disk. | |
| indent | No | Indentation space count (default 2). | |
| locales | No | Optional list of locales to format. Defaults to all project locales. | |
| sortOrder | No | Sort order: 'alphabetical' (natural A-Z sort across all levels) or 'align-with-source' (orders target locale keys to match the source locale). | alphabetical |
| namespaces | No | Optional list of namespaces to format. | |
| projectPath | No | Optional project root directory. Defaults to current working directory. |