Skip to content

优化 Minecraft Wiki 跳转功能#4372

Merged
Glavo merged 4 commits intoHMCL-dev:mainfrom
Glavo:lzh-wiki
Sep 1, 2025
Merged

优化 Minecraft Wiki 跳转功能#4372
Glavo merged 4 commits intoHMCL-dev:mainfrom
Glavo:lzh-wiki

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented Sep 1, 2025

  • 修复中文环境下部分版本无法跳转的问题
  • 修复无法正确选择简体/繁体页面的问题
  • 支持文言文环境中跳转至礦藝大典

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the Minecraft Wiki jump functionality by fixing several issues with version navigation across different language environments.

  • Fixed wiki URL generation to properly handle Chinese simplified/traditional page selection
  • Added support for Classical Chinese (文言文) environment to redirect to 礦藝大典 (lzh.minecraft.wiki)
  • Replaced search-based URLs with direct page links for better accuracy

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
I18N*.properties Updated wiki URL patterns from search-based to direct page links for all languages
MinecraftWiki.java New comprehensive wiki link generation logic with language-specific handling
Locales.java Added i18n helper methods and renamed variable for clarity
I18n.java Refactored i18n methods and added wiki link generation entry point
VersionsPage.java Removed inline wiki URL logic and delegated to centralized MinecraftWiki class

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +36 to +41
if (wikiVersion.startsWith("2.0"))
translatedVersion = "二點〇";
else if (wikiVersion.startsWith("1.0.0-rc2"))
translatedVersion = WenyanUtils.translateGameVersion(GameVersionNumber.asGameVersion("1.0.0-rc2"));
else
translatedVersion = WenyanUtils.translateGameVersion(gameVersion);
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded string '二點〇' should be defined as a constant or moved to the WenyanUtils class for consistency with other translation logic.

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +89
switch (lower) {
case "0.30-1":
case "0.30-2":
case "c0.30_01c":
wikiVersion = "Classic_0.30";
break replace;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This large switch statement with many hardcoded version mappings should be extracted into a separate configuration file or constants class to improve maintainability and reduce code complexity.

Copilot uses AI. Check for mistakes.
@Glavo Glavo merged commit 10e5e7b into HMCL-dev:main Sep 1, 2025
2 checks passed
@Glavo Glavo deleted the lzh-wiki branch September 1, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants