{"id":18859,"date":"2024-11-19T15:14:54","date_gmt":"2024-11-19T07:14:54","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18859\/"},"modified":"2024-11-19T15:14:54","modified_gmt":"2024-11-19T07:14:54","slug":"%e5%88%86%e4%ba%abgitlab%e5%ae%89%e8%a3%85%e6%b1%89%e5%8c%96%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18859\/","title":{"rendered":"\u5206\u4eabGitlab\u5b89\u88c5\u6c49\u5316\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u7248\u672c\u63a7\u5236\u662f\u975e\u5e38\u91cd\u8981\u7684\u73af\u8282\u3002\u800c gitlab \u4f5c\u4e3a\u4e00\u4e2a\u5f3a\u5927\u7684 git \u4ed3\u5e93\uff0c\u63d0\u4f9b\u4e86\u5b8c\u5584\u7684\u7248\u672c\u63a7\u5236\u529f\u80fd\u3002\u7136\u800c\uff0c\u5728\u9ed8\u8ba4\u7684\u60c5\u51b5\u4e0b\uff0cgitlab \u5e76\u6ca1\u6709\u63d0\u4f9b\u4e2d\u6587\u8bed\u8a00\u5305\u3002\u8fd9\u5c31\u8ba9\u5f88\u591a\u9700\u8981\u4e2d\u6587\u754c\u9762\u7684\u7528\u6237\u611f\u5230\u975e\u5e38\u7684\u4e0d\u4fbf\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c31\u6765\u5206\u4eab\u4e00\u4e0b gitlab \u5b89\u88c5\u6c49\u5316\u7684\u65b9\u6cd5\u3002<\/p>\n<h2>\u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5 Gitlab<\/h2>\n<p>Gitlab \u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u5b98\u7f51\u7684\u6307\u5f15\uff0c\u4e0b\u8f7d\u5bf9\u5e94\u7684\u5b89\u88c5\u5305\u5e76\u6267\u884c\u5b89\u88c5\u547d\u4ee4\u5373\u53ef\u3002\u82e5\u662f\u4e0d\u4e86\u89e3\u5b89\u88c5\u6b65\u9aa4\u7684\u8bfb\u8005\uff0c\u8bf7\u53c2\u7167 Gitlab \u5b98\u65b9\u6587\u6863<\/p>\n<h2>\u7b2c\u4e8c\u6b65\uff1a\u4e0b\u8f7d\u6c49\u5316\u8bed\u8a00\u5305<\/h2>\n<p>\u8bbf\u95ee Gitlab \u7684\u8bed\u8a00\u5305\u4ed3\u5e93\uff1ahttps:\/\/gitlab.com\/xhang\/gitlablang\/-\/tree\/master\/zh-CN\uff0c\u9009\u62e9\u81ea\u5df1\u9700\u8981\u7684\u7248\u672c\uff08\u9009\u62e9\u6700\u65b0\u7684\u7248\u672c\u5373\u53ef\uff09\uff0c\u5e76\u4e0b\u8f7d\u539f\u59cb\u6570\u636e\u5305\uff0c\u5f97\u5230\u4e00\u4e2a\u540d\u4e3a zh_cn.yml \u7684\u6587\u4ef6\u3002<\/p>\n<h2>\u7b2c\u4e09\u6b65\uff1a\u5207\u6362\u5230 root \u7528\u6237\u5e76\u5728 Gitlab \u7684\u9ed8\u8ba4\u76ee\u5f55\u4e0b\u65b0\u5efa\u8bed\u8a00\u5305\u6587\u4ef6\u5939<\/h2>\n<p>\u5728\u7edd\u5927\u591a\u6570\u7684 Linux \u53d1\u884c\u7248\u4e2d\uff0c\u90fd\u9ed8\u8ba4\u5b89\u88c5\u4e86 root \u7528\u6237\u8d26\u6237\u3002\u6211\u4eec\u53ef\u4f7f\u7528 su \u547d\u4ee4\u5207\u6362\u5230 root \u7528\u6237\uff0c\u5e76\u5728 Gitlab \u7684\u9ed8\u8ba4\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3a locale \u7684\u6587\u4ef6\u5939\u3002Gitlab \u7684\u9ed8\u8ba4\u76ee\u5f55\u5728\u4e0d\u540c\u7684\u7cfb\u7edf\u4e2d\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\uff0c\u56e0\u6b64\uff0c\u8981\u6839\u636e\u81ea\u5df1\u7cfb\u7edf\u4e2d Gitlab \u7684\u5b89\u88c5\u76ee\u5f55\u8fdb\u884c\u8bbe\u7f6e\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cGitlab \u5b89\u88c5\u5728 \/usr\/local\/gitlab\/ \u4e0b\u3002<\/p>\n<pre>su\nmkdir -p \/usr\/local\/gitlab\/embedded\/service\/gitlab-rails\/config\/locales\/<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h2>\u7b2c\u56db\u6b65\uff1a\u5c06\u8bed\u8a00\u5305\u6587\u4ef6\u590d\u5236\u5230 Gitlab \u7684\u914d\u7f6e\u6587\u4ef6\u5939\u4e0b<\/h2>\n<p>\u5c06\u4e0b\u8f7d\u5230\u7684 zh_cn.yml \u6587\u4ef6\u590d\u5236\u5230 config\/locales \u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<pre>cp zh_cn.yml \/usr\/local\/gitlab\/embedded\/service\/gitlab-rails\/config\/locales\/<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h2>\u7b2c\u4e94\u6b65\uff1a\u4fee\u6539 Gitlab \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u9ed8\u8ba4\u8bed\u8a00<\/h2>\n<p>\u7f16\u8f91 Gitlab \u7684\u914d\u7f6e\u6587\u4ef6 \/etc\/gitlab\/gitlab.rb\uff08\u5982\u679c Gitlab \u5b89\u88c5\u5728 \/usr\/local\/gitlab\/ \u4e0b\u7684\u8bdd\uff09\uff0c\u5c06\u9ed8\u8ba4\u8bed\u8a00\u8bbe\u7f6e\u4e3a\u4e2d\u6587 zh-CN<\/p>\n<pre>vim \/etc\/gitlab\/gitlab.rb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre>gitlab_rails['default_locale'] = 'zh-CN'<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h2>\u7b2c\u516d\u6b65\uff1a\u6267\u884c Gitlab \u7684\u914d\u7f6e\u6587\u4ef6\u66f4\u65b0\u548c\u91cd\u542f\u547d\u4ee4<\/h2>\n<pre>gitlab-ctl reconfigure\ngitlab-ctl restart<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5230\u6b64\uff0cGitlab \u7684\u6c49\u5316\u5b89\u88c5\u5df2\u7ecf\u5b8c\u6210\u4e86\u3002\u6253\u5f00 Gitlab \u7f51\u7ad9\uff0c\u60a8\u4f1a\u53d1\u73b0\u9ed8\u8ba4\u8bed\u8a00\u5df2\u7ecf\u53d8\u4e3a\u4e2d\u6587\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>Gitlab \u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u7248\u672c\u63a7\u5236\u8f6f\u4ef6\uff0c\u4f46\u662f\u9ed8\u8ba4\u6ca1\u6709\u4e2d\u6587\u8bed\u8a00\u5305\uff0c\u5bf9\u4e8e\u4e0d\u719f\u6089\u82f1\u6587\u754c\u9762\u7684\u7528\u6237\u6765\u8bf4\uff0c\u53ef\u80fd\u4f1a\u9020\u6210\u4e00\u5b9a\u7684\u56f0\u96be\u3002\u672c\u6587\u5206\u4eab\u4e86 Gitlab \u5b89\u88c5\u6c49\u5316\u7684\u65b9\u6cd5\uff0c\u4f9b\u8bfb\u8005\u53c2\u8003\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5206\u4eabGitlab\u5b89\u88c5\u6c49\u5316\u7684\u65b9\u6cd5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\uff0c\u7248\u672c\u63a7\u5236\u662f\u975e\u5e38\u91cd\u8981\u7684\u73af\u8282\u3002\u800c gitlab \u4f5c\u4e3a\u4e00\u4e2a\u5f3a\u5927\u7684 git \u4ed3\u5e93\uff0c\u63d0\u4f9b\u4e86\u5b8c\u5584\u7684\u7248\u672c\u63a7\u5236\u529f\u80fd\u3002\u7136\u800c\uff0c\u5728\u9ed8\u8ba4\u7684\u60c5\u51b5\u4e0b\uff0cgitlab \u5e76\u6ca1\u6709\u63d0\u4f9b\u4e2d\u6587\u8bed\u8a00\u5305\u3002\u8fd9\u5c31\u8ba9\u5f88\u591a\u9700\u8981\u4e2d\u6587\u754c\u9762\u7684\u7528\u6237\u611f\u5230\u975e\u5e38\u7684\u4e0d\u4fbf\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c31\u6765\u5206\u4eab\u4e00\u4e0b gitlab \u5b89\u88c5\u6c49\u5316\u7684\u65b9\u6cd5\u3002 \u7b2c\u4e00\u6b65\uff1a\u5b89\u88c5 Gitlab Gitlab \u5b89\u88c5\u8fc7\u7a0b\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u6309\u7167\u5b98\u7f51\u7684\u6307\u5f15\uff0c\u4e0b\u8f7d\u5bf9\u5e94\u7684\u5b89\u88c5\u5305\u5e76\u6267\u884c\u5b89\u88c5\u547d\u4ee4\u5373\u53ef\u3002\u82e5\u662f\u4e0d\u4e86\u89e3\u5b89\u88c5\u6b65\u9aa4\u7684\u8bfb\u8005\uff0c\u8bf7\u53c2\u7167 Gitlab \u5b98\u65b9\u6587\u6863 \u7b2c\u4e8c\u6b65\uff1a\u4e0b\u8f7d\u6c49\u5316\u8bed\u8a00\u5305 \u8bbf\u95ee Gitlab \u7684\u8bed\u8a00\u5305\u4ed3\u5e93\uff1ahttps:\/\/gitlab.com\/xhang\/gitlablang\/-\/tree\/master\/zh-CN\uff0c\u9009\u62e9\u81ea\u5df1\u9700\u8981\u7684\u7248\u672c\uff08\u9009\u62e9\u6700\u65b0\u7684\u7248\u672c\u5373\u53ef\uff09\uff0c\u5e76\u4e0b\u8f7d\u539f\u59cb\u6570\u636e\u5305\uff0c\u5f97\u5230\u4e00\u4e2a\u540d\u4e3a zh_cn.yml \u7684\u6587\u4ef6\u3002 \u7b2c\u4e09\u6b65\uff1a\u5207\u6362\u5230 root \u7528\u6237\u5e76\u5728 Gitlab \u7684\u9ed8\u8ba4\u76ee\u5f55\u4e0b\u65b0\u5efa\u8bed\u8a00\u5305\u6587\u4ef6\u5939 \u5728\u7edd\u5927\u591a\u6570\u7684 Linux \u53d1\u884c\u7248\u4e2d\uff0c\u90fd\u9ed8\u8ba4\u5b89\u88c5\u4e86 root \u7528\u6237\u8d26\u6237\u3002\u6211\u4eec\u53ef\u4f7f\u7528 su \u547d\u4ee4\u5207\u6362\u5230 root \u7528\u6237\uff0c\u5e76\u5728 Gitlab \u7684\u9ed8\u8ba4\u76ee\u5f55\u4e0b\u65b0\u5efa\u4e00\u4e2a\u540d\u4e3a locale \u7684\u6587\u4ef6\u5939\u3002Gitlab \u7684\u9ed8\u8ba4\u76ee\u5f55\u5728\u4e0d\u540c\u7684\u7cfb\u7edf\u4e2d\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\uff0c\u56e0\u6b64\uff0c\u8981\u6839\u636e\u81ea\u5df1\u7cfb\u7edf\u4e2d Gitlab \u7684\u5b89\u88c5\u76ee\u5f55\u8fdb\u884c\u8bbe\u7f6e\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cGitlab \u5b89\u88c5\u5728 \/usr\/local\/gitlab\/ \u4e0b\u3002 su mkdir -p \/usr\/local\/gitlab\/embedded\/service\/gitlab-rails\/config\/locales\/ \u767b\u5f55\u540e\u590d\u5236 \u7b2c\u56db\u6b65\uff1a\u5c06\u8bed\u8a00\u5305\u6587\u4ef6\u590d\u5236\u5230 Gitlab \u7684\u914d\u7f6e\u6587\u4ef6\u5939\u4e0b \u5c06\u4e0b\u8f7d\u5230\u7684 zh_cn.yml \u6587\u4ef6\u590d\u5236\u5230 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-18859","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18859"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18859\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}