Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Glavo
Copy link
Member

@Glavo Glavo commented Nov 5, 2025

本 PR 实现了网站的本地化。

现在网站支持英语和中文,入口点分别为 https://docs.hmcl.net/en/https://docs.hmcl.net/zh/。访问 https://docs.hmcl.net 将会通过 JS 脚本判断用户的语言,然后自动跳转到合适的页面。

目前我翻译了部分页面,未翻译的页面会自动回退到中文。

页面中一些元素(比如 title)目前难以进行本地化。我在考虑未来不再使用 gem 安装 minimal-mistakes 主题,而是将该主题完整复制到本仓库中,这样我们可以更深度地对其进行定制。

@Glavo
Copy link
Member Author

Glavo commented Nov 5, 2025

Copy link
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 implements internationalization (i18n) for the HMCL documentation website by adding multi-language support through Jekyll Polyglot. The refactoring splits previously combined Chinese/English pages into separate language-specific files and introduces automatic language detection and redirection.

  • Adds jekyll-polyglot plugin for multi-language support with Chinese, English, and "und" (undetermined) languages
  • Splits bilingual content pages into separate _en.md and _zh.md files with language-specific permalinks
  • Creates a select_language.html layout that automatically redirects users based on browser language preference

Reviewed Changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
_layouts/select_language.html New layout template implementing automatic language detection and redirection
index.md, index_en.md, index_zh.md Splits homepage into language-specific versions
_downloads/**/*.md Refactors all download pages from bilingual to separate language files
_config.yml Configures Polyglot plugin with supported languages
Gemfile Adds jekyll-polyglot dependency
_data/*/navigation.yml Adds language-specific navigation files
_docs/crash-support-group.md Updates asset link references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@burningtnt

This comment was marked as resolved.

@Glavo
Copy link
Member Author

Glavo commented Nov 5, 2025

“亮色”文本未能正确本地化。

现在 HTML 的 lang 标签不对劲,所以不是特别好处理。我想在将 minimal-mistakes 合并到本仓库后再实现。

@Glavo Glavo requested a review from Copilot November 5, 2025 13:57
Copy link
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

Copilot reviewed 52 out of 52 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



<script>
/* 等待 5 秒. */
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

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

Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.

Copilot uses AI. Check for mistakes.


<script>
/* 等待 5 秒. */
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

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

Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.

Copilot uses AI. Check for mistakes.


<script>
/* 等待 5 秒. */
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

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

Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.

Copilot uses AI. Check for mistakes.


<script>
/* 等待 5 秒. */
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

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

Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.

Suggested change
/* 等待 5 . */
/* Wait 5 seconds. */

Copilot uses AI. Check for mistakes.
@Glavo
Copy link
Member Author

Glavo commented Nov 5, 2025

@github-actions github-actions bot added the preview/watch Watched pull requests label Nov 5, 2025
@3gf8jv4dv
Copy link
Contributor

「当前站点为预览构建而非官方文档。如需反馈问题,请前往 #XXX 留言。」

这句话没本地化。

@burningtnt
Copy link
Member

“亮色”文本未能正确本地化。

现在 HTML 的 lang 标签不对劲,所以不是特别好处理。我想在将 minimal-mistakes 合并到本仓库后再实现。

应当在本 PR 中一并完成相关修改。

@Glavo
Copy link
Member Author

Glavo commented Nov 6, 2025

从 minimal-mistakes 中复制了一部分文件,现在网站大部分地方应该已经完成本地化了。

@burningtnt burningtnt removed the preview/watch Watched pull requests label Nov 6, 2025
@burningtnt
Copy link
Member

burningtnt commented Nov 6, 2025

@3gf8jv4dv
Copy link
Contributor

对于提供了多语言的文章,是否需要在文章开头添加原始文章以及译者信息。

@burningtnt burningtnt added the preview/watch Watched pull requests label Nov 6, 2025
@Glavo
Copy link
Member Author

Glavo commented Nov 6, 2025

是否需要在文章开头添加原始文章

我考虑做一个不同语言页面之间切换的按钮

以及译者信息。

感觉不是很必要?

@3gf8jv4dv
Copy link
Contributor

3gf8jv4dv commented Nov 6, 2025

以及译者信息。

感觉不是很必要?

对于广大 (潜在的) 国际用户而言,英文文章的译者信息可以提供一个参考。

例如文章是否为 LLM 翻译、译者是否为原始文章作者、译者相关 credit、译者是否为 HMCL 活跃贡献者/维护者,等等。

这样有助于提高透明度。

@neveler
Copy link
Contributor

neveler commented Nov 6, 2025

我感觉会不会有些复杂了,如果给每个语言单独配置一套 config 然后分别生成产物会好一些。

我之前通过上述方案实现了一个版本,但如果是 /{lang}/* 这种的会更简单一点,因为多语言并不共用同一文件夹所以无需合并文件夹的逻辑。

比如:

先构建跳转页面到 _site
然后构建中文到 _site/zh
然后构建英文到 _site/en

@Glavo
Copy link
Member Author

Glavo commented Nov 7, 2025

我感觉会不会有些复杂了,如果给每个语言单独配置一套 config 然后分别生成产物会好一些。

我之前通过上述方案实现了一个版本,但如果是 /{lang}/* 这种的会更简单一点,因为多语言并不共用同一文件夹所以无需合并文件夹的逻辑。

比如:

先构建跳转页面到 _site 然后构建中文到 _site/zh 然后构建英文到 _site/en

我没理解你说的方案哪里简单了,我觉得比现在的方案复杂多了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview/watch Watched pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants