---
name: translation-diff-export
description: Compares UniGetUI JSON locale files against English, identifies untranslated or source-changed keys, and generates patch, reference, and handoff files for a target language. Use when the user asks to export missing translations, untranslated strings, i18n diffs, or locale-file changes.
title: translation-diff-export
canonical_url: https://skilld.dev/gh/devolutions/unigetui/translation-diff-export
last_updated: 2026-11-14T03:45:32.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [scripts/export-translation-diff.ps1](https://skilld.dev/api/skills-raw/devolutions/unigetui/translation-diff-export/scripts/export-translation-diff.ps1), [scripts/test-translation-diff.ps1](https://skilld.dev/api/skills-raw/devolutions/unigetui/translation-diff-export/scripts/test-translation-diff.ps1), [scripts/TranslationDiff.JsonTools.ps1](https://skilld.dev/api/skills-raw/devolutions/unigetui/translation-diff-export/scripts/TranslationDiff.JsonTools.ps1).
>
> If the user asked to install this Skill, run `npx skilld install devolutions/unigetui/translation-diff-export`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/translation-diff-export`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/devolutions/unigetui/translation-diff-export) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/translation-diff-export`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/translation-diff-export --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/translation-diff-export --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# translation diff export

Use this skill when you need a small UniGetUI translation patch instead of sending a full language JSON file for review or translation.

It exports only the active untranslated or source-changed strings, creates the translator handoff files, and prepares the patch set needed by `translation-diff-translate` and `translation-diff-import`.

## Prerequisites

- PowerShell 7 (`pwsh`).
- `git` available on `PATH`.
- `cirup` available on `PATH`.

When source strings changed, run `translation-source-sync` first so `lang_en.json` reflects current source usage before exporting downstream translation patches.

## Scripts

- `scripts/export-translation-diff.ps1`: Exports JSON patch artifacts and generates a translation handoff prompt.
- `scripts/test-translation-diff.ps1`: Runs a local end-to-end smoke test against the checked-in UniGetUI language files.

Use this skill's wrapper scripts first; the downstream translate and import steps are documented in [translation-diff-translate](../translation-diff-translate/SKILL.md) and [translation-diff-import](../translation-diff-import/SKILL.md).

## Usage

Export untranslated French strings only:

```powershell
pwsh ./.agents/skills/translation-diff-export/scripts/export-translation-diff.ps1 \
  -NeutralJson ./src/Languages/lang_en.json \
  -TargetJson ./src/Languages/lang_fr.json \
  -Language fr
```

Export untranslated French strings plus English source values changed since `origin/main`:

```powershell
pwsh ./.agents/skills/translation-diff-export/scripts/export-translation-diff.ps1 \
  -NeutralJson ./src/Languages/lang_en.json \
  -TargetJson ./src/Languages/lang_fr.json \
  -Language fr \
  -BaseRef origin/main
```

Optional parameters:

- `-OutputDir` (default: `generated/translation-diff-export`)
- `-KeepIntermediate`

Run the built-in smoke test:

```powershell
pwsh ./.agents/skills/translation-diff-export/scripts/test-translation-diff.ps1
```

## Output

For `lang_en.json` and language `fr`, the script generates:

- `generated/translation-diff-export/lang.diff.fr.source.json`
- `generated/translation-diff-export/lang.diff.fr.translated.json`
- `generated/translation-diff-export/lang.diff.fr.reference.json`
- `generated/translation-diff-export/lang.diff.fr.prompt.md`

If `-KeepIntermediate` is used, git-baseline snapshots are kept under `generated/translation-diff-export/tmp/`.

The smoke test writes its temporary artifacts under `generated/translation-diff-export-demo/`.

## Validate The Export

After export, confirm the patch is usable before handing it off:

1. Check that `.source.json` is not empty unless you expected no work for that language.
2. Confirm `.translated.json` is sparse and does not contain copied English placeholders for unfinished keys.
3. If the patch should include recent English changes, rerun with `-BaseRef` and compare the resulting `.source.json`.
4. Run the smoke test if you changed the export workflow itself.

## Hand Off To Translate

After exporting the patch, use the generated `.prompt.md` file with [translation-diff-translate](../translation-diff-translate/SKILL.md) to update the sparse translated working copy.

## Hand Off To Import

After translating the patch, merge it back into the full language file with [translation-diff-import](../translation-diff-import/SKILL.md):

```powershell
pwsh ./.agents/skills/translation-diff-import/scripts/import-translation-diff.ps1 \
  -TranslatedPatch ./generated/translation-diff-export/lang.diff.fr.translated.json \
  -SourcePatch ./generated/translation-diff-export/lang.diff.fr.source.json \
  -TargetJson ./src/Languages/lang_fr.json \
  -NeutralJson ./src/Languages/lang_en.json \
  -OutputJson ./src/Languages/lang_fr.merged.json
```

Keep the `.translated.json` file sparse. If a key is not translated yet, leave it out instead of copying the English source value into the working copy.