translation-source-sync

Synchronizes UniGetUI English language files with translation keys used in C# and XAML source code.

25.9k|915|Updated Jun 15, 2021
One-click install
npx skills add https://github.com/Devolutions/UniGetUI --skill translation-source-sync
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: translation-source-sync
Source: https://github.com/Devolutions/UniGetUI/tree/main/.agents/skills/translation-source-sync
Command: npx skills add https://github.com/Devolutions/UniGetUI --skill translation-source-sync

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

When UniGetUI source code changes, the English language file lang_en.json drifts out of sync with the strings actually used in the application, leaving missing keys, unused entries, and inconsistently ordered locale files that translators must reconcile manually.

Core Features & Use Cases

  • Source Scanning and Sync: Extracts literal translation keys from C# (CoreTools.Translate, CoreTools.AutoTranslated), WinUI XAML, and Avalonia AXAML patterns, then adds missing keys and removes unused entries from lang_en.json.
  • Locale Reordering: Reorders non-English locale files to match the English key ordering, appending unmapped locale-only keys at the end.
  • Drift Detection and Smoke Testing: Supports -CheckOnly modes to report drift without writing changes, plus a smoke test that runs against a temporary synthetic repo.
  • Use Case: After renaming a translatable string in a C# view model, run the sync script to update lang_en.json, review warnings about interpolated Translate calls, then reorder locale files and verify translations before handing off to translators.

Quick Start

Ask the assistant to sync the UniGetUI English language file with the source code and report any missing or unused translation keys.

Frequently Asked Questions about translation-source-sync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync translation keys with source code in UniGetUI?

Run the sync-translation-sources.ps1 wrapper script, which scans C#, WinUI XAML, and Avalonia AXAML files for literal translation calls and updates lang_en.json by adding missing keys and removing unused ones. Use the -CheckOnly flag to preview drift without writing changes.

How do I find missing translation keys in a C# application?

The sync script extracts keys from CoreTools.Translate and CoreTools.AutoTranslated calls in C#, plus TranslatedTextBlock and t:Translate markup in XAML, then compares them against lang_en.json. Missing keys are added with the key as the default value.

Can I reorder locale JSON files to match the English key order?

Yes, run set-translation-boundary-order.ps1 to reorder non-English locale files so they follow the English file as the canonical order. Locale-only keys that have no English counterpart are appended at the end, and -CheckOnly previews the changes.

Does the translation sync handle interpolated strings like Translate($"...")?

No, interpolated translation calls such as CoreTools.Translate($"Running {value}") are out of scope and are not synchronized automatically. The script reports warnings for these cases so you can convert them to stable literals or add the English keys manually.

Will running the translation sync modify my checked-in language files unexpectedly?

The sync script rewrites lang_en.json in place by design, but you can run it with -CheckOnly first to inspect drift safely. The smoke test uses a temporary synthetic repository, so it never mutates the checked-in language files.