Skip to content

Feat: Help documents display with perferred language

张泽华请求将help-doc-with-preferred-language合并到main-jh

What does this MR do and why?

Related to issue #1809 (closed)

Context #1809 (comment 1561358)

我们在 jh 目录下的 help_controller 中添加了一些逻辑,来使 help document 的查找目录根据用户的 locale 来进行改变,当用户的 locale 为英文时,如果 jh/doc/en 中有相应的 md 文件,那么优先查找 jh/doc/en 目录下的 md 文件,否则查找 doc 目录下的文件,当用户的 locale 为中文或其他语言时,查找 jh/doc 目录下的 md 文件。

这样就实现了我们可以在 jh/doc/en 目录下放置我们想覆盖的英文文档,对于一些我们需要修改的英文文档,优先显示 jh/doc/en 目录下的文档。对于中文用户或其他语言用户,直接显示中文。

更新

由于上述方案使用 jh/doc/en 这个路径存储 jh 英文文档会影响先有的文档系统,相关 issue https://jihulab.com/gitlab-cn/gitlab/-/issues/2417, 所以调整为 jh/doc-en 这个目录。

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

张泽华 编辑于

合并请求报告