GitLab 汉化指南(安装/升级)

手工安装与升级

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

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

对于中国大陆境内的服务器用户,可以使用 https://git.coding.net/larryli/gitlab.git 镜像(镜像手工同步,比 gitlab.com 上略有延迟)。

另外也可以在 Install Gems 步骤中使用 https://gems.ruby-china.org/ 镜像加快 gems 安装。具体步骤如下:

cd /home/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

# 或 GitCafe.com 镜像
git clone https://git.coding.net/larryli/gitlab.git

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

# 7.13 版本的汉化补丁
git diff origin/7-13-stable..7-13-zh > ../7.13.diff

然后上传 7.13.diff 文件到服务器。

# 停止 gitlab
sudo gitlab-ctl stop
sudo patch -D /opt/gitlab/embedded/service/gitlab-rails -p1 < 7.13.diff

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

sudo gitlab-ctl start

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

5 Responses to “GitLab 汉化指南(安装/升级)”

  1. linsche说道:
    UC Browser 5.4.4237.31 Windows 10 x64 Edition
    Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 UBrowser/5.4.4237.31 Safari/537.36

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

    # 7.13 版本的汉化补丁
    git diff origin/7-13-stable..7-13-zh > ../7.13.diff

    请问这句是比较两个版本库吗?origin/7-13-stable..7-13-zh中..分割的是两个路径还是?

    • 南 靖男说道:
      Android Webkit 4.0 Android 4.1.1
      Mozilla/5.0 (Linux; U; Android 4.1.1; zh-cn; MI 2A Build/JRO03L) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

      git diff 的比较,请参见 git diff –help

      • linsche说道:
        UC Browser 5.4.4237.31 Windows 10 x64 Edition
        Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 UBrowser/5.4.4237.31 Safari/537.36

        谢谢,问题已解决。

        cd /opt/gitlab/embedded/service/gitlab-rails
        git apply 7.14.diff

        这样也是可以的,使用git自带的打补丁方法。

  2. WordPress 4.4.2
    The Incutio XML-RPC PHP Library -- WordPress/4.4.2

    […] 以下汉化步骤参考此篇文章,首先确认当前安装版本 […]

  3. WordPress 4.7.3
    The Incutio XML-RPC PHP Library -- WordPress/4.7.3

    […] 本文參考了 https://larryli.cn/2015/07/644905. […]

快速安装 GitLab 并汉化 - IT大道进行回复取消回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据