在 Debian 上汉化 GitLab,通常有两种常见方式:
下面以 Omnibus 方式安装的 GitLab(最常见) 为例说明。
sudo gitlab-rake gitlab:env:info
如果是 Omnibus GitLab,继续下面的步骤。
GitLab 官方从 12 版本起已支持部分中文,但完整汉化通常使用社区包:
sudo gitlab-ctl stop
sudo cp -r /opt/gitlab/embedded/service/gitlab-rails{,.bak}
根据你的 GitLab 版本选择对应补丁(非常关键):
cd /tmp
git clone https://github.com/larryli/gitlab.git
或指定版本(示例):
git clone --branch v16.0.1-zh https://github.com/larryli/gitlab.git
sudo cp -rf /tmp/gitlab/* \
/opt/gitlab/embedded/service/gitlab-rails/
sudo gitlab-ctl reconfigure
sudo gitlab-ctl start
如果只是想让 Debian 显示中文:
sudo apt install locales
sudo dpkg-reconfigure locales
选择 zh_CN.UTF-8
⚠️ 这 不会汉化 GitLab 界面
如果你告诉我:
我可以给你更精确的汉化方案。