Skip to content

refactor: Adopt XAML-first localization and resources improvements - #44

Merged
000hen merged 7 commits into
masterfrom
refactor/resources-improvement
Jul 16, 2026
Merged

000hen merged 7 commits into
masterfrom
refactor/resources-improvement

Conversation

@000hen

@000hen 000hen commented Jul 16, 2026

Copy link
Copy Markdown
Owner

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 ./... (from engine/)
  • dotnet test app/JustHostMC.Core.Tests/JustHostMC.Core.Tests.csproj
  • I performed any relevant manual testing. / 我已完成相關的手動測試。

Screenshots / 螢幕截圖

Checklist / 檢查清單

  • The change is focused and does not include unrelated edits. / 這項變更範圍明確,且未包含無關修改。
  • I updated tests for changed behavior where practical. / 我已在適當情況下更新測試,以涵蓋行為變更。
  • I updated documentation for user-facing or developer-facing changes. / 我已更新與使用者或開發者相關的文件。
  • I regenerated protobuf outputs locally if files under proto/ changed. / 若修改了 proto/,我已在本機重新產生 protobuf 輸出。
  • I did not commit credentials, private server data, or generated build artifacts. / 我未提交憑證、私人伺服器資料或建置產物。

000hen added 7 commits July 16, 2026 17:29
- 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
@000hen
000hen merged commit e633828 into master Jul 16, 2026
2 checks passed
@000hen
000hen deleted the refactor/resources-improvement branch July 16, 2026 16:36
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