Conversation
There was a problem hiding this comment.
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-polyglotplugin for multi-language support with Chinese, English, and "und" (undetermined) languages - Splits bilingual content pages into separate
_en.mdand_zh.mdfiles with language-specific permalinks - Creates a
select_language.htmllayout 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.
This comment was marked as resolved.
This comment was marked as resolved.
现在 HTML 的 |
There was a problem hiding this comment.
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 秒. */ |
There was a problem hiding this comment.
Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.
|
|
||
|
|
||
| <script> | ||
| /* 等待 5 秒. */ |
There was a problem hiding this comment.
Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.
|
|
||
|
|
||
| <script> | ||
| /* 等待 5 秒. */ |
There was a problem hiding this comment.
Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.
|
|
||
|
|
||
| <script> | ||
| /* 等待 5 秒. */ |
There was a problem hiding this comment.
Comment is written in Chinese ('Wait 5 seconds') in an English language file. Should be changed to English.
| /* 等待 5 秒. */ | |
| /* Wait 5 seconds. */ |
|
「当前站点为预览构建而非官方文档。如需反馈问题,请前往 #XXX 留言。」 这句话没本地化。 |
我考虑做一个不同语言页面之间切换的按钮
感觉不是很必要? |
对于广大 (潜在的) 国际用户而言,英文文章的译者信息可以提供一个参考。 例如文章是否为 LLM 翻译、译者是否为原始文章作者、译者相关 credit、译者是否为 HMCL 活跃贡献者/维护者,等等。 这样有助于提高透明度。 |
|
我感觉会不会有些复杂了,如果给每个语言单独配置一套 config 然后分别生成产物会好一些。 我之前通过上述方案实现了一个版本,但如果是 /{lang}/* 这种的会更简单一点,因为多语言并不共用同一文件夹所以无需合并文件夹的逻辑。 比如: 先构建跳转页面到 _site |
我没理解你说的方案哪里简单了,我觉得比现在的方案复杂多了。 |
基本上要做的只有把
并没有,现在就是会根据用户语言自动切换 UI 语言。 |
# Conflicts: # 404.md # _docs/contribution.md # _docs/faq.md # _docs/help.md
在哪里?我没有观察到这种现象。 |
This comment was marked as resolved.
This comment was marked as resolved.
改了 |
本地无法复现。 |
This comment was marked as outdated.
This comment was marked as outdated.
|
我研究了一下新引入的 该插件通过 Ruby 的 Monkey Patch 增强了 Jekyll 的
该插件支持通过配置项 Note 这也是导致使用 该插件还提供对 data 文件夹内容的多语言化支持,实现不同语言版本的数据文件分别处理和加载。 |
本 PR 实现了网站的本地化。
现在网站支持英语和中文,入口点分别为
https://docs.hmcl.net/en/和https://docs.hmcl.net/zh/。访问https://docs.hmcl.net将会通过 JS 脚本判断用户的语言,然后自动跳转到合适的页面。目前我翻译了部分页面,未翻译的页面会自动回退到中文。
页面中一些元素(比如 title)目前难以进行本地化。我在考虑未来不再使用 gem 安装 minimal-mistakes 主题,而是将该主题完整复制到本仓库中,这样我们可以更深度地对其进行定制。