Skip to content

fix(i18n): complete the Ukrainian dictionaries - #797

Open
pasharm wants to merge 1 commit into
STranslate:mainfrom
pasharm:fix/complete-ukrainian-dictionaries
Open

pasharm wants to merge 1 commit into
STranslate:mainfrom
pasharm:fix/complete-ukrainian-dictionaries

Conversation

@pasharm

@pasharm pasharm commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

English

uk.xaml was written against main @ 2a75118f. Three commits that landed while #782 was open added keys to every other language, but could not add them to Ukrainian, because uk.xaml did not exist upstream yet:

Commit Keys added Missing from uk
feat: add an optional configurable Compact pin shortcut, refine pinned image translation windows (#769) pinned image translation 6
feat: add notification-only fallback for text selection failure notify-only fallback 2
fix: localize Youdao API error messages across all supported languages Youdao API error messages 78

So at the moment #782 was merged, src/STranslate/Languages/uk.xaml had 784 keys against 792 in every other language, and the Youdao plugin dictionary had 4 against 82. Ukrainian was the only language left behind — ru, fa, tr, ja, ko, zh-cn, zh-tw have no gaps.

This PR fills both files. They are back to the en.xaml key set and order — 792/792 for the main dictionary, 82/82 for the plugin — with the blank-line section breaks in the same places, so each file is now line-for-line structurally identical to its en.xaml. Insertions only: no existing line is touched.

What users saw

English text in those places. The missing keys resolve through the English dictionaries, which stay merged for the whole session: LoadDefaultLanguage loads every plugin's en.xaml and then clears _oldResources, so RemoveOldLanguageFiles never takes them out again. The literal No Translation for key ... appears in one narrower case — a plugin installed during the current session, where LoadInstalledPluginLanguages merges only the active language until the next restart.

Translation

Values were translated from the English and Chinese sources (Chinese being the original) and kept consistent with the terminology already in uk.xaml: розпізнавання (recognition), озвучення / синтез мовлення (TTS), застосунок (application), запит (request), вивантаження (upload), Повторіть спробу пізніше (try again later), не підтримується (not supported). Pin is Закріпити, matching the existing Hotkey_ToggleTopmost → Закріпити поверх усіх вікон.

All 86 values were run through LanguageTool with the uk-UA profile; the warnings it raised are fixed, and the current text comes back clean.

Verification

Windows 10 x64, .NET SDK 10, on top of main @ fa640384:

  • dotnet build src/STranslate.slnx -c Debug — 0 errors;
  • dotnet test src/STranslate.slnx — 296/296 passing;
  • key set and order compared with en.xaml key by key: 792/792 and 82/82, zero differences; the blank/comment layout of both files matches en.xaml line for line;
  • {0}/{1} placeholders compared per key — zero mismatches;
  • no Russian-only letters (ы/ъ/э/ё) in the new values;
  • every language dictionary in the tree loads through XamlReader.Load, and in each folder every language reports the same key count as its en.xaml;
  • diff contains insertions only.

中文

uk.xaml 是基于 main @ 2a75118f 编写的。#782 在 09-04 至 09-09 期间开启,这段时间内合入的三个提交为其他所有语言补充了新 key,但当时上游还没有 uk.xaml,因此乌克兰语被漏下:

提交 新增内容 uk 缺少
feat: add an optional configurable Compact pin shortcut、refine pinned image translation windows(#769) 贴图相关文案 6
feat: add notification-only fallback for text selection failure 「仅通知」回退 2
fix: localize Youdao API error messages across all supported languages 有道 API 错误提示 78

因此在 #782 合入时,src/STranslate/Languages/uk.xaml 只有 784 个 key(其他语言 792 个),有道插件词典只有 4 个(应为 82 个)。乌克兰语是唯一被漏下的语言:ru、fa、tr、ja、ko、zh-cn、zh-tw 均无缺失。

本 PR 补齐这两个文件:与 en.xaml 的 key 集合与顺序完全一致(主词典 792/792,插件 82/82),空行分节的位置也一致,因此两个文件现在与各自的 en.xaml 逐行同构。只有新增行,未改动任何既有行。

用户实际看到的是什么

是英文文案。缺失的 key 会落到英文词典上,而英文词典在整个会话期间都留在 MergedDictionaries 里:LoadDefaultLanguage 会加载每个插件的 en.xaml,随后清空 _oldResources,因此 RemoveOldLanguageFiles 不会再把它们移除。只有一种较窄的情况会出现 No Translation for key ... 原文:插件是在当前会话中安装的,此时 LoadInstalledPluginLanguages 只合并当前语言,直到下次重启。

翻译

译文依据英文与中文原文(中文为原始文案)翻译,术语与已合入的 uk.xaml 保持一致:розпізнавання(识别)、озвучення / синтез мовлення(语音合成)、застосунок(应用)、запит(请求)、вивантаження(上传)、Повторіть спробу пізніше(稍后重试)、не підтримується(不受支持)。Pin 译作 Закріпити,与既有的 Hotkey_ToggleTopmost → Закріпити поверх усіх вікон 一致。

全部 86 条译文都用 LanguageTool 的 uk-UA 配置检查过,提示到的问题均已修正,当前文本无告警。

验证

Windows 10 x64,.NET SDK 10,基于 main @ fa640384:

  • dotnet build src/STranslate.slnx -c Debug —— 0 错误;
  • dotnet test src/STranslate.slnx —— 296/296 通过;
  • 与 en.xaml 逐 key 比对集合与顺序:792/792、82/82,无差异;两个文件的空行与注释布局也与 en.xaml 逐行一致;
  • 逐 key 比对 {0}/{1} 占位符:无差异;
  • 新增译文中没有俄语专有字母(ы/ъ/э/ё);
  • 树内所有语言词典均通过 XamlReader.Load 加载,且每个目录下各语言的 key 数量与 en.xaml 相同;
  • diff 仅包含新增行。

`uk.xaml` was written against `main` @ `2a75118f`. Three commits that landed
while STranslate#782 was open added keys to every other language, but could not add them
to Ukrainian, because `uk.xaml` did not exist upstream yet:

- 8 keys in `src/STranslate/Languages/uk.xaml` — pinned image translation (STranslate#769)
  and the notification-only fallback for text selection;
- 78 keys in the Youdao plugin dictionary — the localized API error messages.

So Ukrainian users saw English text in those places: the missing keys resolve
through the English dictionaries, which stay merged for the whole session
(`LoadDefaultLanguage` loads every plugin's `en.xaml` and then clears
`_oldResources`, so `RemoveOldLanguageFiles` never takes them out). The one case
where the raw `No Translation for key ...` shows up is a plugin installed in the
current session: `LoadInstalledPluginLanguages` merges only the active language
for it until the next restart.

Both files are back to the `en.xaml` key set *and* order: 792/792 for the main
dictionary, 82/82 for the plugin, with the blank-line section breaks in the same
places, so each file is now line-for-line structurally identical to its
`en.xaml`. Insertions only, no existing line is touched.

Verified: `dotnet build -c Debug` 0 errors, `dotnet test` 296/296, every language
dictionary in the tree loads through `XamlReader.Load` with the same key count as
its `en.xaml` neighbour, and the new values pass LanguageTool with the `uk-UA`
profile with no remaining warnings.
@pasharm
pasharm force-pushed the fix/complete-ukrainian-dictionaries branch from cea05d9 to 2f95765 Compare September 9, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant