Files
LanMountainDesktop/.trae/specs/localization-fix/tasks.md
lincube fc4d0c4cd8 Support .laapp/plugin.json and improve market models
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.
2026-04-30 00:02:52 +08:00

2.8 KiB
Raw Blame History

本地化修复 Tasks

Task 1: MainWindow.axaml 硬编码文本移除与代码覆盖

  • 1.1 在 MainWindow.axaml 中,将任务栏头像弹窗的 UserSettingsEdit DesktopPowerText 属性改为空或绑定(保留 x:Name
  • 1.2 在 MainWindow.axaml 中,将电源菜单的 BackPowerShutdownRestartLog OutSleepLock ScreenText 属性改为空或绑定
  • 1.3 在 MainWindow.axaml 中,将组件库的 WidgetsBackNo components.Text 属性改为空或绑定
  • 1.4 在 MainWindow.axaml 中,将悬浮芯片的 WidgetsText 属性改为空或绑定
  • 1.5 在 MainWindow.SettingsHardCut.Stubs.csApplyLocalization() 中补充上述所有控件的 L() 赋值

Task 2: Launcher 视图本地化

  • 2.1 在 LanMountainDesktop.Launcher 中引入 LocalizationService(或共享主应用服务)
  • 2.2 为 Launcher 创建独立的 Localization/ 目录和 zh-CN.json / en-US.json
  • 2.3 修改 SplashWindow.axaml:将 LanMountain DesktopInitializing... 改为动态绑定
  • 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:将 PenEraserClearExport SVG Tooltip 改为绑定,并在代码后置中通过 L() 设置
  • 3.3 HolidayCalendarWidget.axaml:将 Holiday countdownDays 改为绑定,并在代码后置中通过 L() 设置
  • 3.4 BilibiliHotSearchWidget.axaml:将 Trending Topic 改为绑定,并在代码后置中通过 L() 设置
  • 3.5 WallpaperSettingsPage.axaml:将 Custom color Tooltip 改为绑定到 settings.wallpaper.custom_color_tooltip

Task 4: 本地化资源文件补充

  • 4.1 在 zh-CN.json 中补充以下键值:
    • browser.widget.unavailable
    • whiteboard.tool.penwhiteboard.tool.eraserwhiteboard.tool.clearwhiteboard.tool.export_svg
    • holiday.widget.titleholiday.widget.days
    • bilihot.widget.trending_topic
    • power.user(或复用现有键)
  • 4.2 在 en-US.json 中补充上述键值的英文版本
  • 4.3 为 Launcher 创建独立的本地化 JSON 文件并填充中英文

Task 5: 验证

  • 5.1 执行 dotnet build LanMountainDesktop.slnx -c Debug 确保编译通过
  • 5.2 检查是否有遗漏的硬编码英文(通过正则搜索)