Skip to content

Commit 58cf0c2

Browse files
Move language files, prune legacy strings, and translate all languages to 100% (#4647)
1 parent 936bf05 commit 58cf0c2

90 files changed

Lines changed: 6571 additions & 28909 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/translation-diff-export/SKILL.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,35 +30,24 @@ Export untranslated French strings only:
3030

3131
```powershell
3232
pwsh ./.agents/skills/translation-diff-export/scripts/export-translation-diff.ps1 \
33-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
34-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
33+
-NeutralJson ./src/Languages/lang_en.json \
34+
-TargetJson ./src/Languages/lang_fr.json \
3535
-Language fr
3636
```
3737

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

4040
```powershell
4141
pwsh ./.agents/skills/translation-diff-export/scripts/export-translation-diff.ps1 \
42-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
43-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
42+
-NeutralJson ./src/Languages/lang_en.json \
43+
-TargetJson ./src/Languages/lang_fr.json \
4444
-Language fr \
4545
-BaseRef origin/main
4646
```
4747

48-
Export only the active section above the legacy boundary marker:
49-
50-
```powershell
51-
pwsh ./.agents/skills/translation-diff-export/scripts/export-translation-diff.ps1 \
52-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
53-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
54-
-Language fr \
55-
-ActiveOnly
56-
```
57-
5848
Optional parameters:
5949

6050
- `-OutputDir` (default: `generated/translation-diff-export`)
61-
- `-ActiveOnly` (limits `.source.json` and `.reference.json` to keys above `__LEGACY_TRANSLATION_KEYS_BELOW__`)
6251
- `-KeepIntermediate`
6352

6453
Run the built-in smoke test:
@@ -101,9 +90,9 @@ After translating the patch, merge it back into the full language file with [tra
10190
pwsh ./.agents/skills/translation-diff-import/scripts/import-translation-diff.ps1 \
10291
-TranslatedPatch ./generated/translation-diff-export/lang.diff.fr.translated.json \
10392
-SourcePatch ./generated/translation-diff-export/lang.diff.fr.source.json \
104-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
105-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
106-
-OutputJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.merged.json
93+
-TargetJson ./src/Languages/lang_fr.json \
94+
-NeutralJson ./src/Languages/lang_en.json \
95+
-OutputJson ./src/Languages/lang_fr.merged.json
10796
```
10897

10998
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.

.agents/skills/translation-diff-export/scripts/test-translation-diff.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ $ErrorActionPreference = 'Stop'
1010
. (Join-Path $PSScriptRoot 'TranslationDiff.JsonTools.ps1')
1111

1212
$repoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..\..\..\..'))
13-
$neutralPath = Join-Path $repoRoot 'src\UniGetUI.Core.LanguageEngine\Assets\Languages\lang_en.json'
14-
$targetPath = Join-Path $repoRoot ('src\UniGetUI.Core.LanguageEngine\Assets\Languages\lang_{0}.json' -f $Language)
13+
$neutralPath = Join-Path $repoRoot 'src\Languages\lang_en.json'
14+
$targetPath = Join-Path $repoRoot ('src\Languages\lang_{0}.json' -f $Language)
1515
$exportScript = Join-Path $PSScriptRoot 'export-translation-diff.ps1'
1616
$importScript = Join-Path $repoRoot '.agents\skills\translation-diff-import\scripts\import-translation-diff.ps1'
1717
$validateScript = Join-Path $repoRoot '.agents\skills\translation-diff-import\scripts\validate-language-file.ps1'

.agents/skills/translation-diff-import/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ Import the translated French working copy from the export skill into the full Fr
2727
pwsh ./.agents/skills/translation-diff-import/scripts/import-translation-diff.ps1 \
2828
-TranslatedPatch ./generated/translation-diff-export/lang.diff.fr.translated.json \
2929
-SourcePatch ./generated/translation-diff-export/lang.diff.fr.source.json \
30-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
31-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
32-
-OutputJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.merged.json
30+
-TargetJson ./src/Languages/lang_fr.json \
31+
-NeutralJson ./src/Languages/lang_en.json \
32+
-OutputJson ./src/Languages/lang_fr.merged.json
3333
```
3434

3535
Validate the merged output:
3636

3737
```powershell
3838
pwsh ./.agents/skills/translation-diff-import/scripts/validate-language-file.ps1 \
39-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
40-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.merged.json \
39+
-NeutralJson ./src/Languages/lang_en.json \
40+
-TargetJson ./src/Languages/lang_fr.merged.json \
4141
-PatchJson ./generated/translation-diff-export/lang.diff.fr.source.json
4242
```
4343

.agents/skills/translation-diff-translate/SKILL.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ pwsh ./.agents/skills/translation-diff-translate/scripts/write-translation-hando
3232
-SourcePatch ./generated/translation-diff-export/lang.diff.fr.source.json \
3333
-TranslatedPatch ./generated/translation-diff-export/lang.diff.fr.translated.json \
3434
-ReferencePatch ./generated/translation-diff-export/lang.diff.fr.reference.json \
35-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
36-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
37-
-MergedTargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.merged.json \
35+
-TargetJson ./src/Languages/lang_fr.json \
36+
-NeutralJson ./src/Languages/lang_en.json \
37+
-MergedTargetJson ./src/Languages/lang_fr.merged.json \
3838
-ValidationScript ./.agents/skills/translation-diff-import/scripts/validate-language-file.ps1 \
3939
-OutputPrompt ./generated/translation-diff-export/lang.diff.fr.prompt.md
4040
```
@@ -58,12 +58,12 @@ Merge the sparse working copy back into the full destination-language file:
5858
pwsh ./.agents/skills/translation-diff-import/scripts/import-translation-diff.ps1 \
5959
-TranslatedPatch ./generated/translation-diff-export/lang.diff.fr.translated.json \
6060
-SourcePatch ./generated/translation-diff-export/lang.diff.fr.source.json \
61-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
62-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
63-
-OutputJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.merged.json
61+
-TargetJson ./src/Languages/lang_fr.json \
62+
-NeutralJson ./src/Languages/lang_en.json \
63+
-OutputJson ./src/Languages/lang_fr.merged.json
6464
6565
pwsh ./.agents/skills/translation-diff-import/scripts/validate-language-file.ps1 \
66-
-NeutralJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json \
67-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.merged.json \
66+
-NeutralJson ./src/Languages/lang_en.json \
67+
-TargetJson ./src/Languages/lang_fr.merged.json \
6868
-PatchJson ./generated/translation-diff-export/lang.diff.fr.source.json
6969
```

.agents/skills/translation-review/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,31 @@ Generate a Markdown review report for French:
4040

4141
```powershell
4242
pwsh ./.agents/skills/translation-review/scripts/review-translation-json.ps1 \
43-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_fr.json \
43+
-TargetJson ./src/Languages/lang_fr.json \
4444
-Language fr
4545
```
4646

4747
Generate a report for Ukrainian and include script-detection checks:
4848

4949
```powershell
5050
pwsh ./.agents/skills/translation-review/scripts/review-translation-json.ps1 \
51-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_ua.json \
51+
-TargetJson ./src/Languages/lang_ua.json \
5252
-Language ua
5353
```
5454

5555
Generate a flagged-only JSON report with no cross-language table:
5656

5757
```powershell
5858
pwsh ./.agents/skills/translation-review/scripts/review-translation-json.ps1 \
59-
-TargetJson ./src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_de.json \
59+
-TargetJson ./src/Languages/lang_de.json \
6060
-Language de \
6161
-OutputFormat Json \
6262
-FlaggedOnly
6363
```
6464

6565
Optional parameters:
6666

67-
- `-NeutralJson` — defaults to `src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json`
67+
- `-NeutralJson` — defaults to `src/Languages/lang_en.json`
6868
- `-ComparisonLanguages` — languages to include in the comparison table; defaults to other checked-in `lang_*.json` files
6969
- `-OutputPath` — defaults to `generated/translation-review/review.<lang>.md`
7070
- `-OutputFormat``Markdown` (default) or `Json`

.agents/skills/translation-review/scripts/review-translation-json.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ $repoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..\..\..\..'
2323
. (Join-Path $repoRoot 'scripts\translation\Languages\TranslationJsonTools.ps1')
2424

2525
function Get-TranslationReviewLanguageReferencePath {
26-
return Join-Path $repoRoot 'src\UniGetUI.Core.LanguageEngine\Assets\Data\LanguagesReference.json'
26+
return Join-Path $repoRoot 'src\Languages\Data\LanguagesReference.json'
2727
}
2828

2929
function Get-TranslationReviewLanguagesDirectory {
30-
return Join-Path $repoRoot 'src\UniGetUI.Core.LanguageEngine\Assets\Languages'
30+
return Join-Path $repoRoot 'src\Languages'
3131
}
3232

3333
function Get-TranslationReviewLanguageReference {

.agents/skills/translation-source-sync/SKILL.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
---
22
name: translation-source-sync
3-
description: Synchronizes the UniGetUI English language file with source-code usage, identifies missing translation keys, removes unused entries, reports localization drift, and can reorder locale files to the English legacy-boundary layout. Use when the user asks to sync language files, missing translations, i18n drift, or align locale file ordering with English.
3+
description: Synchronizes the UniGetUI English language file with source-code usage, identifies missing translation keys, removes unused entries, reports localization drift, and can reorder locale files to match the English key ordering. Use when the user asks to sync language files, missing translations, i18n drift, or align locale file ordering with English.
44
---
55

66
# translation source sync
77

8-
Use this skill when UniGetUI source code changed and you need to keep [src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json](src/UniGetUI.Core.LanguageEngine/Assets/Languages/lang_en.json) aligned with the strings actually used by the application, or when you need downstream locale files reordered to match the English active and legacy sections.
8+
Use this skill when UniGetUI source code changed and you need to keep [src/Languages/lang_en.json](src/Languages/lang_en.json) aligned with the strings actually used by the application, or when you need downstream locale files reordered to match the English key ordering.
99

10-
It scans supported C#, WinUI XAML, and Avalonia AXAML patterns, finds missing English keys, removes unused entries, reports translation-source warnings that still need manual cleanup, and can align locale file ordering to the English legacy-boundary layout.
10+
It scans supported C#, WinUI XAML, and Avalonia AXAML patterns, finds missing English keys, removes unused entries, reports translation-source warnings that still need manual cleanup, and can align locale file ordering to the English layout.
1111

1212
## Scope
1313

1414
- Extract literal translation keys from supported UniGetUI source patterns.
1515
- Add new English keys missing from `lang_en.json`.
1616
- Remove English keys that are no longer used.
17-
- Preserve legacy English keys below the reserved boundary marker when the boundary workflow is enabled.
18-
- Reorder non-English locale files to match the English active and legacy key ordering.
17+
- Reorder non-English locale files to match the English key ordering.
1918
- Warn about interpolated `CoreTools.Translate($"...")` calls that are not synchronized automatically.
2019
- Leave downstream language propagation to the existing translation diff workflow.
2120

@@ -56,7 +55,7 @@ Check whether the English file is out of sync without writing changes:
5655
pwsh ./.agents/skills/translation-source-sync/scripts/sync-translation-sources.ps1 -CheckOnly
5756
```
5857

59-
Reorder locale files to match the English active section and legacy-boundary tail:
58+
Reorder locale files to match the English key ordering:
6059

6160
```powershell
6261
pwsh ./.agents/skills/translation-source-sync/scripts/set-translation-boundary-order.ps1
@@ -79,7 +78,7 @@ pwsh ./.agents/skills/translation-source-sync/scripts/test-translation-source-sy
7978
1. Run translation source sync after changing any translatable source string.
8079
2. If `-CheckOnly` reports drift, run the full sync to rewrite `lang_en.json`.
8180
3. Review warnings for interpolated translation calls and convert them to stable literals or add the missing English keys manually when needed.
82-
4. If you are using the legacy-boundary workflow, run `pwsh ./.agents/skills/translation-source-sync/scripts/set-translation-boundary-order.ps1` to align locale ordering with English.
81+
4. Run `pwsh ./.agents/skills/translation-source-sync/scripts/set-translation-boundary-order.ps1` to align locale ordering with English.
8382
5. Run `pwsh ./scripts/translation/Verify-Translations.ps1` to confirm the language files still validate cleanly.
8483
6. Run `pwsh ./.agents/skills/translation-source-sync/scripts/test-translation-source-sync.ps1` if you changed the sync workflow itself.
8584
7. Export changed work for translators with [translation-diff-export](../translation-diff-export/SKILL.md).
@@ -88,5 +87,5 @@ pwsh ./.agents/skills/translation-source-sync/scripts/test-translation-source-sy
8887

8988
- Existing English values are preserved for retained keys; newly added English entries default to `key == value`.
9089
- The sync script preserves current key order for retained entries and appends newly discovered keys deterministically.
91-
- The locale reorder script follows English as the canonical order and moves unmapped locale-only keys to the legacy section after the reserved boundary marker.
90+
- The locale reorder script follows English as the canonical order and appends unmapped locale-only keys at the end.
9291
- The smoke test uses a temporary synthetic repo so it does not mutate the checked-in language files.

.agents/skills/translation-status/SKILL.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: translation-status
3-
description: Analyzes checked-in UniGetUI language files to calculate translation percentages, surface untranslated coverage data, and generate localization status reports. Boundary-aware: completion is computed from the active English section above the legacy marker.
3+
description: Analyzes checked-in UniGetUI language files to calculate translation percentages, surface untranslated coverage data, and generate localization status reports.
44
---
55

66
# translation status
@@ -45,15 +45,13 @@ pwsh ./.agents/skills/translation-status/scripts/get-translation-status.ps1 \
4545
- `Code`: language code
4646
- `Language`: display name
4747
- `Completion`: computed completion percentage using English active keys only
48-
- `Translated`, `Missing`, `Empty`, `SourceEqual`, `Extra`: per-language entry counts for the active baseline
49-
- `Legacy`: count of locale keys stored below the legacy boundary marker
48+
- `Translated`, `Missing`, `Empty`, `SourceEqual`, `Extra`: per-language entry counts
5049
- `Stored` and `Delta`: stored percentage metadata and difference from the computed result
5150

5251
## Notes
5352

5453
- The script treats source-equal values as untranslated for non-English languages.
55-
- When `lang_en.json` contains the legacy boundary marker, completion excludes legacy compatibility keys below the marker.
56-
- `Extra` excludes shared English legacy keys and only counts locale-only keys not present in English active or legacy sections.
54+
- `Extra` counts locale-only keys not present in the English file.
5755
- Use `-IncludeEnglish` if you want the `en` row included in the report.
5856
- Use `-OnlyIncomplete` to focus on languages that still need work.
5957
- For the full parameter surface, inspect `../../../../scripts/translation/Get-TranslationStatus.ps1`.

.github/workflows/translation-validation.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66
paths:
77
- 'scripts/translation/**'
88
- '.agents/skills/translation-*/scripts/**'
9-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Languages/**'
10-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Data/LanguagesReference.json'
11-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Data/TranslatedPercentages.json'
12-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Data/Translators.json'
9+
- 'src/Languages/**'
10+
- 'src/Languages/Data/LanguagesReference.json'
11+
- 'src/Languages/Data/TranslatedPercentages.json'
12+
- 'src/Languages/Data/Translators.json'
1313
- 'src/UniGetUI.Core.Data/Assets/Data/Contributors.list'
1414
- '.github/workflows/translation-validation.yml'
1515

@@ -18,10 +18,10 @@ on:
1818
paths:
1919
- 'scripts/translation/**'
2020
- '.agents/skills/translation-*/scripts/**'
21-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Languages/**'
22-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Data/LanguagesReference.json'
23-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Data/TranslatedPercentages.json'
24-
- 'src/UniGetUI.Core.LanguageEngine/Assets/Data/Translators.json'
21+
- 'src/Languages/**'
22+
- 'src/Languages/Data/LanguagesReference.json'
23+
- 'src/Languages/Data/TranslatedPercentages.json'
24+
- 'src/Languages/Data/Translators.json'
2525
- 'src/UniGetUI.Core.Data/Assets/Data/Contributors.list'
2626
- '.github/workflows/translation-validation.yml'
2727

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ File-based settings via `Settings.Get(Settings.K.*)` / `Settings.Set(Settings.K.
7676
Use `Logger.Info()`, `Logger.Warn()`, `Logger.Error()`, `Logger.Debug()`, `Logger.ImportantInfo()` from `UniGetUI.Core.Logging`. Accepts both `string` and `Exception` parameters.
7777

7878
### Localization
79-
Use `CoreTools.Translate("text")` for all user-facing strings. Parameterized: `CoreTools.Translate("{0} packages found", count)`. In XAML, use the `TranslatedTextBlock` control. Translation assets live under `src/UniGetUI.Core.LanguageEngine/Assets/`; do not assume Tolgee-based automation exists in this repository.
79+
Use `CoreTools.Translate("text")` for all user-facing strings. Parameterized: `CoreTools.Translate("{0} packages found", count)`. In XAML, use the `TranslatedTextBlock` control. Translation assets live under `src/Languages/`; do not assume Tolgee-based automation exists in this repository.
8080

8181
### Naming
8282
- Types, methods, properties: **PascalCase**

0 commit comments

Comments
 (0)