Repository navigation
feat(i18n): add Ukrainian language support - #782
Merged
Merged
Conversation
Adds a complete Ukrainian (`uk`) UI translation, following the checklist in
src/docs/i18n-internationalization.md:
- src/STranslate/Languages/uk.xaml: 784 keys, same key set and order as en.xaml
- AvailableLanguages: registered in all three places, including the
GetSystemTranslation branch ("uk" => "Система")
- 21 plugins x (uk.xaml + uk.json) = 42 files
- language table in the i18n doc
No .csproj changes: the existing Languages globs pick the new files up.
Ukrainian is LTR, so no layout changes are needed.
This was referenced Sep 9, 2026
pasharm
added a commit
to pasharm/STranslate
that referenced
this pull request
Sep 9, 2026
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
English
What
Adds a complete Ukrainian (
uk) UI translation, followingsrc/docs/i18n-internationalization.mdstep by step.Languages/uk.xaml, same keys asen.xamlAvailableLanguages(all three places)GetSystemTranslationbranch ("uk" => "Система")uk.xaml+uk.json) = 42 filesLanguage code is the short form
uk, matching the VS Code locale convention used by the project. Ukrainian is LTR, so no layout changes are needed.Files
No
.csprojchanges: the existing globs (Languages\*.xamlinSTranslate.csproj,Languages\*.*in every plugin project) already pick the new files up.How the translation was produced
Same author and same method as the Russian translation in #770. Ukrainian is a separate language rather than a transliteration of Russian, so every value was translated and then re-read for false friends and calques, with the English and Chinese sources consulted wherever the wording is about what a setting actually does. Terminology is kept consistent across the main dictionary and all 21 plugin dictionaries (переклад / розпізнавання тексту / озвучення / словник / гарячі клавіші / буфер обміну / тайм-аут / проксі / плагін / сервіс / знімок екрана / поле введення / тека / журнали / налаштування), and the whole file was run through LanguageTool with the
uk-UAprofile.Key names, comments and element order are taken from
en.xamlunchanged. Verified mechanically againsten.xaml: 784/784 keys, same set and same order; 17 in both files and 11xml:space="preserve"in both; zero mismatches in{0}/{1}/{2}placeholders, compared key by key; zero Russian-only letters (ы/ъ/ё/э) anywhere in the 43 new translation files. The only 14 values left equal to the English ones are the intentionally untranslatable ones (HTTP,Socks5,Markdown,Latex,WebDav, numeric options, proxy host names).Verification
Windows 10 x64, .NET SDK 10.0.400, on top of
main@2a75118f:dotnet build src/STranslate.slnx -c Debug— 0 errors;dotnet test src/STranslate.slnx— 274/274 passing;XamlReader.Loadwithout errors, and the main one reports exactly 784 keys;uk.xamlis copied to the outputLanguages/folder by the existing glob;uk.xaml/uk.jsonhas the same key set as itsencounterpart.Follow-up (not part of this PR)
While checking the language registry I noticed that
src/STranslate/Languages/fa.xaml(added in #765) is not registered inAvailableLanguages, andfais missing from the language table insrc/docs/i18n-internationalization.md. As far as I can tell the Persian UI language therefore never appears in the language dropdown and the file is currently dead weight. That is a pre-existing issue unrelated to this PR, so it is left alone here — happy to send a one-line fix separately if you want it.中文
内容
新增完整的乌克兰语(
uk)界面翻译,严格按src/docs/i18n-internationalization.md的 Checklist 完成:Languages/uk.xaml:784 个 key,与en.xaml的 key 集合和顺序完全一致;AvailableLanguages三处都已注册,包括最容易遗漏的GetSystemTranslation分支("uk" => "Система");uk.xaml+uk.json,共 42 个文件;语言代码用短码
uk。乌克兰语是从左到右书写,无需 RTL 相关改动。不涉及.csproj改动:Languages\*.xaml/Languages\*.*通配符已自动包含新文件。翻译方式
与 #770 的俄语翻译出自同一作者、同一方法。乌克兰语是独立语言而非俄语的转写:每条取值都重新翻译,并逐条排查与俄语的假朋友和直译痕迹;凡涉及「这个设置到底做什么」的措辞,都对照英文与中文原文确认。主程序词典与 21 个插件词典的术语保持统一,全文另经 LanguageTool 的
uk-UA规则集校对。key 名称、注释与元素顺序完全沿用
en.xaml。已机器校验:784/784 个 key,集合与顺序均一致;两个文件各有 17 处 、11 处xml:space="preserve";逐 key 比对{0}/{1}/{2}占位符,0 处不一致;43 个新翻译文件中不存在俄语专有字母(ы/ъ/ё/э)。仅 14 个取值与英文相同,均为本就不需要翻译的内容(HTTP、Socks5、Markdown、Latex、WebDav、数字选项、代理主机名)。验证结果
Windows 10 x64、.NET SDK 10.0.400,在
main@2a75118f之上:dotnet build src/STranslate.slnx -c Debug0 错误;dotnet test src/STranslate.slnx274/274 通过;XamlReader.Load正常加载,主词典恰好 784 个 key;uk.xaml由既有通配符正确复制到输出目录的Languages/;uk.xaml/uk.json与其en版本 key 集合一致。附带发现(不在本 PR 范围内)
src/STranslate/Languages/fa.xaml(#765 引入)并未在AvailableLanguages中注册,src/docs/i18n-internationalization.md的语言表里也没有fa。因此波斯语界面应该从未出现在语言下拉框中,该文件目前处于闲置状态。这是本 PR 之前就存在的问题,这里不做改动;如果需要,我可以另开一个 PR 补上这一行。