汉化指南
手工安装与升级
推荐按照 gitlab-ce 源代码中 doc/install/installation.md 的内容手工安装 GitLab 中文版本。
相关修改只需要在 Clone the Source 步骤中使用 https://gitlab.com/larryli/gitlab.git
仓库和当前版本的 8-6-zh
即可。
对于中国大陆境内的服务器用户,可以使用 https://git.coding.net/larryli/gitlab.git
镜像(镜像手工同步,比 gitlab.com 上略有延迟)。
另外也可以在 Install Gems 步骤中使用 https://gems.ruby-china.org
镜像加快 gems 安装。具体步骤如下:
cd /home/git/gitlab
sudo -u git -H bundle config mirror.https://rubygems.org https://gems.ruby-china.org
# For PostgreSQL (note, the option says "without ... mysql")
sudo -u git -H bundle install --deployment --without development test mysql aws kerberos
# Or if you use MySQL (note, the option says "without ... postgres")
sudo -u git -H bundle install --deployment --without development test postgres aws kerberos
对于升级操作也可以按照相应的 update.md 类似处理即可。
官方推荐的 Omnibus 安装
请先使用官方包安装或升级完成,确认当前版本。
sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
并确认当前汉化版本的 VERSION 是否相同。
如果安装版本小于当前汉化版本,请先升级。如果安装版本大于当前汉化版本,请在本项目中提交新的 issue。
如果版本相同,首先在本地 clone 仓库。
# GitLab.com 仓库
git clone https://gitlab.com/larryli/gitlab.git
# 或 Coder.net 镜像
git clone https://git.coding.net/larryli/gitlab.git
然后比较汉化分支和原分支,导出 patch 用的 diff 文件。
# 8.1 版本的汉化补丁
git diff origin/8-6-stable..8-6-zh > ../8.6.diff
然后上传 8.6.diff
文件到服务器。
# 停止 gitlab
sudo gitlab-ctl stop
sudo patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 8.6.diff
确定没有 .rej 文件,重启 GitLab 即可。
sudo gitlab-ctl start
如果汉化中出现问题,请重新安装 GitLab(注意备份数据)。