Repository navigation
refactor: Adopt XAML-first localization and resources improvements - #44
Merged
Merged
Conversation
- Move static UI text into x:Uid resources and add/clean many UIDs and ContentDialog XAML shells - Add JustHostMC.App.ResourceTests to validate RESW/XAML parity, IDs, duplicates, and programmatic exceptions - Document resource architecture and rules in docs/resources.md - Replace custom BoolToVisibility converter with CommunityToolkit.WinUI.Converters and add package reference - Update LocalizationService to map dotted keys to MRT slash lookup and restrict ILocalizer to runtime/backend keys - Introduce PermissionLabel control and refactor viewmodels/models to expose semantic enums/flags instead of inline localized strings
- remove x:Uid from Window root XAML to avoid applying Window.Title during InitializeComponent and crashing XAML load - copy TitleBar.Title to Window.Title immediately after InitializeComponent in affected window constructors - update .resw files to make TitleBar.Title the canonical resource and remove Window.Title entries - add tests that detect Window root x:Uid and verify TitleBar->Window copy - update docs with guidance and add a regex used by the new tests
- Add DefaultContentDialogStyle to dialog XAML roots - Move ContentDialogSizing.Apply into dialog constructors, using useWideLayout for wide dialogs - Remove sizing calls from parent pages, windows, and controls - Update tests and documentation to enforce the policy
- update GetSectionDescription to build keys with '_' instead of '.' - add ShopLocalizationContractTests to assert the catalog key convention
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 / 摘要
This PR refactors the resources to adopt XAML-first localization, fixes window titles localization by copying the TitleBar title instead of applying to the Window root directly, and applies standard ContentDialog sizing to the Server Rename dialog.
Testing / 測試
go test ./...(fromengine/)dotnet test app/JustHostMC.Core.Tests/JustHostMC.Core.Tests.csprojScreenshots / 螢幕截圖
Checklist / 檢查清單
proto/changed. / 若修改了proto/,我已在本機重新產生 protobuf 輸出。