汉化gitlab

一、,基于 Larry Li 版汉化指南 修改

(以9-0-stable-zh分支为例)

源码安装汉化

推荐按照 gitlab-ce 源代码中 doc/install/installation.md 的内容手工安装 GitLab 中文版本。

相关修改只需要在 Clone the Source 步骤中使用 https://gitlab.com/xhang/gitlab.git 仓库和当前版本的后缀增加 -zh 即可。

另外也可以在 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 安装汉化

1. 手动导出汉化补丁包汉化

请先使用官方包安装或升级完成,确认当前版本。

#获取当前版本
gitlab_version=$(sudo cat /opt/gitlab/embedded/service/gitlab-rails/VERSION)

假设当前版本为***v11.3.3***,并确认汉化版本库是否包含该版本的汉化标签(-zh结尾)。

如果具有相同版本的汉化标签,则首先在本地 clone 仓库。

# 克隆汉化版本库
git clone https://gitlab.com/xhang/gitlab.git
# 如果已经克隆过,则进行更新 git fetch

然后比较汉化标签和原标签,导出 patch 用的 diff 文件。

# 导出11.3版本的汉化补丁
git diff origin/11-3-stable origin/11-3-stable-zh > /tmp/11.3.diff

执行完毕后将生成当前版本的补丁文件,如 9.0.0-zh.diff

导入汉化补丁:

# 停止 gitlab
sudo gitlab-ctl stop
sudo patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < 9.0.0-zh.diff

确定没有 .rej 文件,重启 GitLab 即可。

sudo gitlab-ctl start

执行重新配置命令

sudo gitlab-ctl reconfigure

如果汉化中出现问题,请重新安装 GitLab(注意备份数据)。


二、 自定义补丁:

1. 只有管理员能删除分支

猜你喜欢

转载自www.cnblogs.com/xy51/p/11403873.html