Repository navigation
Conversation
- 以 resw 資源檔與 Tr 標記延伸集中管理介面文字,English 為來源語言 - 新增語言選擇、settings.json 持久化與重新啟動套用 - 翻譯主視窗、移除目錄、通知、對話框與取消流程 - 新增資源鍵、佔位符與語言對應測試,以及翻譯文件
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.
Summary
Add resource-based UI localization to the WinUI app and ship Traditional Chinese (
zh-Hant) and Simplified Chinese (zh-Hans) alongside English.Strings/<tag>/Resources.reswthrough a smallLoc/{loc:Tr Key=…}seam. English remains the source language.%LOCALAPPDATA%\Tiny11Builder\settings.jsonand applied after a restart; the notice offers Restart now.docs/translations.mddescribing the file layout, key rules and how to add another language.LocalizationTests: key parity across languages, non-empty values, matching{0}placeholders, XAML key coverage, and tag normalization (zh-TW→zh-Hant,zh-CN→zh-Hans).Technical build-engine operation names, stage status words, the raw recipe and the build log remain English diagnostics; the interactive interface, removal catalog and user-facing notices are localized.
Why
Related to #651, #652 and #656. The app previously had no resource files at all: every string was hard-coded in XAML or C#.
Implementation notes
ProjectPriFileNameis set toresources.pri; without itResourceLoaderdoes not find the app resources.ApplicationLanguages.PrimaryLanguageOverrideis set before any XAML is parsed, so markup-extension text resolves in the selected language.__separators. MRT treats dots as resource-map separators, so a dotted key such asA.Bcannot also be a parent ofA.B.C.Resources.reswfile plus oneLanguageCatalogentry; the tests enforce parity.Verification
dotnet build src/Tiny11Builder.App/Tiny11Builder.App.csproj -c Release: 0 warnings, 0 errors.LocalizationTests,AppFlowTests,AppChoiceTests,ProjectSupportTests,DeploymentTests).8909da1in this non-elevated environment (SeBackupPrivilege/DISM native tests); the three new localization tests are included in the 529 and no new failures were introduced.settings.json, and Restart now relaunches into the new language.摘要(繁體中文)
為 WinUI 應用程式加入以資源檔為基礎的介面在地化,並隨附英文、繁體中文(
zh-Hant)與簡體中文(zh-Hans)。Strings/<tag>/Resources.resw,透過Loc與{loc:Tr Key=…}解析;英文為來源語言。%LOCALAPPDATA%\Tiny11Builder\settings.json,重新啟動後套用,通知列提供「立即重新啟動」。docs/translations.md說明資源結構與新增語言流程。LocalizationTests:語言鍵一致性、非空值、{0}佔位符一致、XAML 鍵覆蓋,以及語系標籤正規化。建置引擎的操作名稱、階段狀態字、原始配方與建置記錄仍為英文技術診斷;互動介面、移除目錄與使用者可見通知均已翻譯。
驗證:Release 建置 0 警告 0 錯誤;相關測試 85 項全數通過;完整測試的 35 項失敗與未修改前的基準完全相同(此非提權環境缺少
SeBackupPrivilege/DISM),未新增失敗。實機確認兩種中文介面、語言選擇寫入設定,以及重新啟動後套用新語言。