Back to Skills

update_json_localization_file

Update a JSON localization file with additions and deletions while preserving formatting. Use when modifying i18n translation files or syncing localization keys.

2stars1forksUpdated 4/3/2026

Security Assessment

Safe(100/100)
Security Score100/100

About update_json_localization_file

The update_json_localization_file skill updates JSON-based localization files by applying additions, updates, and deletions without changing the file more than necessary. It is designed for i18n workflows where translation keys need to be synced, removed, or modified safely. The skill helps maintain translation files in a predictable way, including when files do not yet exist, while avoiding unnecessary disruption to the existing structure. It also distinguishes between newly added keys and updated keys so the result can be summarized clearly after the operation.

Its core capabilities include reading an existing JSON file, parsing it while preserving nested object structure, deleting keys through dot notation, and adding or updating keys in nested paths by creating intermediate objects as needed. It can optionally preserve existing key ordering or sort keys alphabetically at every nesting level. The write process is designed to be safe, using a backup file, a temporary file, and an atomic rename step. Formatting requirements are explicit: 2-space indentation, UTF-8 encoding, Unix line endings, no trailing whitespace, and a final newline. The skill also defines clear error-handling behavior for missing files, permission problems, invalid JSON, and write failures.

This skill is useful for developers, localization engineers, and teams maintaining multilingual applications that store translations in JSON files. Typical use cases include syncing translation keys across locales, removing deprecated strings, applying batch updates to nested translation objects, and standardizing formatting during file maintenance. It is especially relevant in projects where translation files must remain clean, consistent, and easy to review in version control.

FAQ

What kinds of JSON updates does this skill support?

It supports adding new keys, updating existing keys, and deleting keys. Both additions and deletions support dot notation for nested paths, such as "about.title".

What happens if the target localization file does not exist?

If the file is not found, the skill starts from an empty JSON object and creates a new file using the provided additions.

Does this skill preserve the original formatting and key order?

It can preserve existing key order when preserve_formatting is true. If preserve_formatting is false, it sorts keys alphabetically at every nesting level. In both cases, output formatting uses 2-space indentation, UTF-8 encoding, Unix line endings, and a final newline.

How does the skill handle invalid JSON or permission errors?

Invalid JSON should be reported as an error, with a line number if possible. Permission-denied errors should also be reported, and the file should not be modified.

Are empty parent objects removed after deleting nested keys?

No. If deleting a nested key leaves a parent object empty, the empty object is kept.

Install update_json_localization_file

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

ericfitz/tmi-ux