mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
Add support for the new plugin package contract (.laapp + plugin.json) while keeping backward compatibility with legacy .lmdp/manifest.json, and improve market metadata resolution and launcher handling. Key changes: - LanMountainDesktop.Launcher: PluginInstallerService now recognizes plugin.json and .laapp, preserves legacy manifest/package names, searches for manifests with a helper, and removes existing packages matching either extension. - LanMountainDesktop.PluginTemplate: README updated to document .laapp, plugin.json, runtime contract and packaging expectations. - Tests: New and extended tests for PluginInstallerService and a PluginMarketIndexDocumentTests covering nested index parsing and metadata enrichment. - LauncherClient & PluginMarketInstallService: ResolveLauncherPath now probes multiple candidate locations (useful for dev and packaged layouts); LauncherClient also adjusted launcher arguments to use the updated CLI form. - SettingsDomainServices: Added BuildCapabilities to safely build capability lists from entries (null checks, projection, de-dup via DistinctBy). - AirAppMarketMetadataResolverService & PluginMarketModels: Prefer existing manifest/publication/compatibility values when enriching entries, add ApiVersion/Path fields, normalize compatibility logic and package source URL/path handling; handle Sha256/size/publication dates more robustly. - Misc: Added localization spec/checklist/tasks under .trae for a localization fix initiative. These changes enable the new plugin packaging format, improve robustness of market data enrichment, make launcher discovery more flexible for different environments, and add tests and docs to cover the new behaviors.
2.8 KiB
2.8 KiB
本地化修复 Tasks
Task 1: MainWindow.axaml 硬编码文本移除与代码覆盖
- 1.1 在
MainWindow.axaml中,将任务栏头像弹窗的User、Settings、Edit Desktop、Power的Text属性改为空或绑定(保留 x:Name) - 1.2 在
MainWindow.axaml中,将电源菜单的Back、Power、Shutdown、Restart、Log Out、Sleep、Lock Screen的Text属性改为空或绑定 - 1.3 在
MainWindow.axaml中,将组件库的Widgets、Back、No components.的Text属性改为空或绑定 - 1.4 在
MainWindow.axaml中,将悬浮芯片的Widgets的Text属性改为空或绑定 - 1.5 在
MainWindow.SettingsHardCut.Stubs.cs的ApplyLocalization()中补充上述所有控件的L()赋值
Task 2: Launcher 视图本地化
- 2.1 在
LanMountainDesktop.Launcher中引入LocalizationService(或共享主应用服务) - 2.2 为 Launcher 创建独立的
Localization/目录和zh-CN.json/en-US.json - 2.3 修改
SplashWindow.axaml:将LanMountain Desktop、Initializing...改为动态绑定 - 2.4 修改
DataLocationPromptWindow.axaml:将所有文本改为动态绑定 - 2.5 修改
ErrorWindow.axaml:将所有文本改为动态绑定 - 2.6 修改
LoadingDetailsWindow.axaml:将所有文本改为动态绑定 - 2.7 修改
UpdateWindow.axaml:将Update改为动态绑定 - 2.8 在 Launcher 启动流程中初始化语言设置
Task 3: 组件硬编码修复
- 3.1
BrowserWidget.axaml:将Browser runtime unavailable.改为绑定,并在代码后置中通过L()设置 - 3.2
WhiteboardWidget.axaml:将Pen、Eraser、Clear、Export SVGTooltip 改为绑定,并在代码后置中通过L()设置 - 3.3
HolidayCalendarWidget.axaml:将Holiday countdown、Days改为绑定,并在代码后置中通过L()设置 - 3.4
BilibiliHotSearchWidget.axaml:将Trending Topic改为绑定,并在代码后置中通过L()设置 - 3.5
WallpaperSettingsPage.axaml:将Custom colorTooltip 改为绑定到settings.wallpaper.custom_color_tooltip
Task 4: 本地化资源文件补充
- 4.1 在
zh-CN.json中补充以下键值:browser.widget.unavailablewhiteboard.tool.pen、whiteboard.tool.eraser、whiteboard.tool.clear、whiteboard.tool.export_svgholiday.widget.title、holiday.widget.daysbilihot.widget.trending_topicpower.user(或复用现有键)
- 4.2 在
en-US.json中补充上述键值的英文版本 - 4.3 为 Launcher 创建独立的本地化 JSON 文件并填充中英文
Task 5: 验证
- 5.1 执行
dotnet build LanMountainDesktop.slnx -c Debug确保编译通过 - 5.2 检查是否有遗漏的硬编码英文(通过正则搜索)