# Internationalization for GitLab
> 原文:[https://docs.gitlab.com/ee/development/i18n/externalization.html](https://docs.gitlab.com/ee/development/i18n/externalization.html)
* [Setting up GitLab Development Kit (GDK)](#setting-up-gitlab-development-kit-gdk)
* [Tools](#tools)
* [Preparing a page for translation](#preparing-a-page-for-translation)
* [Ruby files](#ruby-files)
* [HAML files](#haml-files)
* [ERB files](#erb-files)
* [JavaScript files](#javascript-files)
* [Dynamic translations](#dynamic-translations)
* [Working with special content](#working-with-special-content)
* [Interpolation](#interpolation)
* [Plurals](#plurals)
* [Namespaces](#namespaces)
* [Dates / times](#dates--times)
* [Best practices](#best-practices)
* [Keep translations dynamic](#keep-translations-dynamic)
* [Splitting sentences](#splitting-sentences)
* [Avoid splitting sentences when adding links](#avoid-splitting-sentences-when-adding-links)
* [Vue components interpolation](#vue-components-interpolation)
* [Updating the PO files with the new content](#updating-the-po-files-with-the-new-content)
* [Validating PO files](#validating-po-files)
* [Adding a new language](#adding-a-new-language)
# Internationalization for GitLab[](#internationalization-for-gitlab "Permalink")
在 GitLab 9.2 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/10669) .
为了使用国际化(i18n),使用了[GNU gettext](https://www.gnu.org/software/gettext/) ,因为它是该任务最常用的工具,并且有许多应用程序可以帮助我们使用它.
## Setting up GitLab Development Kit (GDK)[](#setting-up-gitlab-development-kit-gdk "Permalink")
为了能够在[GitLab 社区版](https://gitlab.com/gitlab-org/gitlab-foss)项目上工作,您必须通过[GDK](https://gitlab.com/gitlab-org/gitlab-development-kit/blob/master/doc/set-up-gdk.md)下载并配置它.
准备好 GitLab 项目后,就可以开始进行翻译了.
## Tools[](#tools "Permalink")
使用以下工具:
1. [`gettext_i18n_rails`](https://github.com/grosser/gettext_i18n_rails) :这个 gem 使我们可以转换模型,视图和控制器中的内容. 此外,它还使我们可以访问以下 Rake 任务:
* `rake gettext:find` :解析 Rails 应用程序中的几乎所有文件,以查找已标记为要翻译的内容. 最后,它将使用找到的新内容更新 PO 文件.
* `rake gettext:pack` :处理 PO 文件并生成二进制的 MO 文件,最终由应用程序使用.
2. [`gettext_i18n_rails_js`](https://github.com/webhippie/gettext_i18n_rails_js) :此 gem 对于使翻译在 JavaScript 中可用非常有用. 它提供以下 Rake 任务:
* `rake gettext:po_to_json` :从 PO 文件中读取内容,并生成包含所有可用翻译的 JSON 文件.
3. PO 编辑器:有多个应用程序可以帮助我们处理 PO 文件, [Poedit](https://poedit.net/download)是一个不错的选择,可用于 macOS,GNU / Linux 和 Windows.
## Preparing a page for translation[](#preparing-a-page-for-translation "Permalink")
我们基本上有 4 种类型的文件:
1. Ruby 文件:基本上是模型和控制器.
2. HAML 文件:这些是视图文件.
3. ERB 文件:用于电子邮件模板.
4. JavaScript 文件:我们主要需要使用 Vue 模板.
### Ruby files[](#ruby-files "Permalink")
例如,如果存在使用原始字符串的方法或变量,则:
```
def hello
"Hello world!"
end
```
Or:
```
hello = "Hello world!"
```
您可以轻松地将该内容标记为要翻译的内容:
```
def hello
_("Hello world!")
end
```
Or:
```
hello = _("Hello world!")
```
在类或模块级别转换字符串时要小心,因为在类加载时它们只会被评估一次.
例如:
```
validates :group_id, uniqueness: { scope: [:project_id], message: _("already shared with this group") }
```
当加载该类时,这将被翻译,并导致错误消息始终位于默认语言环境中.
Active Record’s `:message` option accepts a `Proc`, so we can do this instead:
```
validates :group_id, uniqueness: { scope: [:project_id], message: -> (object, data) { _("already shared with this group") } }
```
**注意:** API( `lib/api/`或`app/graphql` )中的消息无需外部化.
### HAML files[](#haml-files "Permalink")
考虑到 HAML 中的以下内容:
```
%h1 Hello world!
```
您可以使用以下方式将该内容标记为要翻译的内容:
```
%h1= _("Hello world!")
```
### ERB files[](#erb-files "Permalink")
考虑到 ERB 中的以下内容:
```
<h1>Hello world!</h1>
```
您可以使用以下方式将该内容标记为要翻译的内容:
```
<h1><%= _("Hello world!") %></h1>
```
### JavaScript files[](#javascript-files "Permalink")
在 JavaScript 中,我们添加了`__()` (双下划线括号)函数,您可以从`~/locale`文件中导入该函数. 例如:
```
import { __ } from '~/locale';
const label = __('Subscribe');
```
为了测试 JavaScript 翻译,您必须将 GitLab 本地化更改为英语以外的其他语言,并且必须使用`bin/rake gettext:po_to_json`或`bin/rake gettext:compile`生成 JSON 文件.
### Dynamic translations[](#dynamic-translations "Permalink")
有时,运行`bin/rake gettext:find`时,解析器无法找到一些动态转换. 对于这些情况,可以使用[`N_`方法](https://github.com/grosser/gettext_i18n_rails/blob/c09e38d481e0899ca7d3fc01786834fa8e7aab97/Readme.md#unfound-translations-with-rake-gettextfind) .
还有另一种方法可以[转换来自验证错误的消息](https://github.com/grosser/gettext_i18n_rails/blob/c09e38d481e0899ca7d3fc01786834fa8e7aab97/Readme.md#option-a) .
## Working with special content[](#working-with-special-content "Permalink")
### Interpolation[](#interpolation "Permalink")
翻译后的文字中的占位符应与相应源文件的代码样式匹配. 例如使用`%{created_at}`在 Ruby,但`%{createdAt}`在 JavaScript. [添加链接时,](#avoid-splitting-sentences-when-adding-links)请确保[避免拆分句子](#avoid-splitting-sentences-when-adding-links) .
* 在 Ruby / HAML 中:
```
_("Hello %{name}") % { name: 'Joe' } => 'Hello Joe'
```
* 在 Vue 中:
请参见有关[Vue 分量插值](#vue-components-interpolation)的部分.
* 在 JavaScript 中(无法使用 Vue 时):
```
import { __, sprintf } from '~/locale';
sprintf(__('Hello %{username}'), { username: 'Joe' }); // => 'Hello Joe'
```
如果要在翻译中使用标记并且正在使用 Vue,则**必须**使用[`gl-sprintf`](#vue-components-interpolation)组件. 如果由于某种原因您不能使用 Vue,请使用`sprintf`并通过将`false`用作第三个参数来阻止其转义占位符值. 您**必须**使用自己逃避任何插值动态值,例如`escape`从`lodash` .
```
import { escape } from 'lodash';
import { __, sprintf } from '~/locale';
let someDynamicValue = '<script>alert("evil")</script>';
// Dangerous:
sprintf(__('This is %{value}'), { value: `<strong>${someDynamicValue}</strong>`, false);
// => 'This is <strong><script>alert('evil')</script></strong>'
// Incorrect:
sprintf(__('This is %{value}'), { value: `<strong>${someDynamicValue}</strong>` });
// => 'This is <strong><script>alert('evil')</script></strong>'
// OK:
sprintf(__('This is %{value}'), { value: `<strong>${escape(someDynamicValue)}</strong>`, false);
// => 'This is <strong><script>alert('evil')</script></strong>'
```
### Plurals[](#plurals "Permalink")
* 在 Ruby / HAML 中:
```
n_('Apple', 'Apples', 3)
# => 'Apples'
```
使用插值:
```
n_("There is a mouse.", "There are %d mice.", size) % size
# => When size == 1: 'There is a mouse.'
# => When size == 2: 'There are 2 mice.'
```
避免在单个字符串中使用`%d`或计数变量. 这样可以更自然地翻译某些语言.
* 在 JavaScript 中:
```
n__('Apple', 'Apples', 3)
// => 'Apples'
```
使用插值:
```
n__('Last day', 'Last %d days', x)
// => When x == 1: 'Last day'
// => When x == 2: 'Last 2 days'
```
`n_`方法仅应用于获取同一字符串的多个转换,而不能控制针对不同数量显示不同字符串的逻辑. 某些语言具有不同数量的目标复数形式-例如,中文(简体)在我们的翻译工具中仅具有一种目标复数形式. 这意味着翻译者将不得不选择只翻译一个字符串,而翻译在另一种情况下的表现将不符合预期.
例如,更喜欢使用:
```
if selected_projects.one?
selected_projects.first.name
else
n__("Project selected", "%d projects selected", selected_projects.count)
end
```
而不是:
```
# incorrect usage example
n_("%{project_name}", "%d projects selected", count) % { project_name: 'GitLab' }
```
### Namespaces[](#namespaces "Permalink")
命名空间是一种将属于在一起的翻译进行分组的方法. 它们通过在前缀后面加上条形符号( `|` )为我们的翻译人员提供上下文. 例如:
```
'Namespace|Translated string'
```
命名空间具有以下优点:
* 它解决了词义上的歧义,例如: `Promotions|Promote` vs `Epic|Promote`
* 它使翻译人员可以专注于翻译属于相同产品区域而不是任意产品区域的外部化字符串.
* 它提供了语言环境以帮助翻译.
在某些情况下,例如,对于无处不在的 UI 单词和短语(如"取消")或短语(如"保存更改")而言,名称空间可能会适得其反.
命名空间应为 PascalCase.
* 在 Ruby / HAML 中:
```
s_('OpenedNDaysAgo|Opened')
```
如果找不到翻译,它将返回`Opened` .
* 在 JavaScript 中:
```
s__('OpenedNDaysAgo|Opened')
```
注意:应从转换中删除名称空间. 有关[更多详细信息,](translation.html#namespaced-strings)请参见[翻译指南](translation.html#namespaced-strings) .
### Dates / times[](#dates--times "Permalink")
* 在 JavaScript 中:
```
import { createDateTimeFormat } from '~/locale';
const dateFormat = createDateTimeFormat({ year: 'numeric', month: 'long', day: 'numeric' });
console.log(dateFormat.format(new Date('2063-04-05'))) // April 5, 2063
```
这利用了[`Intl.DateTimeFormat`](https://s0developer0mozilla0org.icopy.site/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) .
* 在 Ruby / HAML 中,我们有两种向日期和时间添加格式的方法:
1. **通过`l`帮助器** ,即`l(active_session.created_at, format: :short)` . 我们有一些预定义的[日期](https://gitlab.com/gitlab-org/gitlab/blob/4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e/config/locales/en.yml#L54)和[时间](https://gitlab.com/gitlab-org/gitlab/blob/4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e/config/locales/en.yml#L262)格式. 如果您需要添加新格式,因为代码的其他部分可能会从中受益,则需要将其添加到[en.yml](https://gitlab.com/gitlab-org/gitlab/blob/master/config/locales/en.yml)文件中.
2. **通过`strftime`** ,即`milestone.start_date.strftime('%b %-d')` . 如果在[en.yml 上](https://gitlab.com/gitlab-org/gitlab/blob/master/config/locales/en.yml)定义的格式[均不](https://gitlab.com/gitlab-org/gitlab/blob/master/config/locales/en.yml)符合我们所需的日期/时间规范,并且由于非常特殊而无需将其添加为新格式的情况(例如,仅在单个视图中使用),则我们将使用`strftime` . .
## Best practices[](#best-practices "Permalink")
### Keep translations dynamic[](#keep-translations-dynamic "Permalink")
在某些情况下,将翻译内容保持在数组或哈希中是有意义的.
Examples:
* 下拉列表的映射
* 错误讯息
要存储此类数据,使用常数似乎是最佳选择,但这不适用于翻译.
不好,请避免:
```
class MyPresenter
MY_LIST = {
key_1: _('item 1'),
key_2: _('item 2'),
key_3: _('item 3')
}
end
```
首次加载该类时,将调用翻译方法( `_` ),并将文本翻译为默认语言环境. 无论用户的语言环境是什么,这些值都不会再次转换.
将类方法与备注一起使用时,也会发生类似的情况.
不好,请避免:
```
class MyModel
def self.list
@list ||= {
key_1: _('item 1'),
key_2: _('item 2'),
key_3: _('item 3')
}
end
end
```
此方法将使用用户的语言环境来记住翻译,该用户首先"调用"此方法.
为避免这些问题,请保持翻译动态.
Good:
```
class MyPresenter
def self.my_list
{
key_1: _('item 1'),
key_2: _('item 2'),
key_3: _('item 3')
}.freeze
end
end
```
### Splitting sentences[](#splitting-sentences "Permalink")
请不要拆分句子,因为这会假定句子的语法和结构在所有语言中都是相同的.
例如,以下内容:
```
{{ s__("mrWidget|Set by") }}
{{ author.name }}
{{ s__("mrWidget|to be merged automatically when the pipeline succeeds") }}
```
应该外部化如下:
```
{{ sprintf(s__("mrWidget|Set by %{author} to be merged automatically when the pipeline succeeds"), { author: author.name }) }}
```
#### Avoid splitting sentences when adding links[](#avoid-splitting-sentences-when-adding-links "Permalink")
当在翻译的句子之间使用链接时,这也适用,否则这些文本在某些语言中不可翻译.
* 在 Ruby / HAML 中,而不是:
```
- zones_link = link_to(s_('ClusterIntegration|zones'), 'https://cloud.google.com/compute/docs/regions-zones/regions-zones', target: '_blank', rel: 'noopener noreferrer')
= s_('ClusterIntegration|Learn more about %{zones_link}').html_safe % { zones_link: zones_link }
```
将链接的开始和结束 HTML 片段设置为变量,如下所示:
```
- zones_link_url = 'https://cloud.google.com/compute/docs/regions-zones/regions-zones'
- zones_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: zones_link_url }
= s_('ClusterIntegration|Learn more about %{zones_link_start}zones%{zones_link_end}').html_safe % { zones_link_start: zones_link_start, zones_link_end: '</a>'.html_safe }
```
* 在 Vue 中,而不是:
```
<template>
<div>
<gl-sprintf :message="s__('ClusterIntegration|Learn more about %{link}')">
<template #link>
<gl-link
href="https://cloud.google.com/compute/docs/regions-zones/regions-zones"
target="_blank"
>zones</gl-link>
</template>
</gl-sprintf>
</div>
</template>
```
将链接的开始和结束 HTML 片段设置为占位符,如下所示:
```
<template>
<div>
<gl-sprintf :message="s__('ClusterIntegration|Learn more about %{linkStart}zones%{linkEnd}')">
<template #link="{ content }">
<gl-link
href="https://cloud.google.com/compute/docs/regions-zones/regions-zones"
target="_blank"
>{{ content }}</gl-link>
</template>
</gl-sprintf>
</div>
</template>
```
* 在 JavaScript 中(无法使用 Vue 时),而不是:
```
{{
sprintf(s__("ClusterIntegration|Learn more about %{link}"), {
link: '<a href="https://cloud.google.com/compute/docs/regions-zones/regions-zones" target="_blank" rel="noopener noreferrer">zones</a>'
})
}}
```
将链接的开始和结束 HTML 片段设置为占位符,如下所示:
```
{{
sprintf(s__("ClusterIntegration|Learn more about %{linkStart}zones%{linkEnd}"), {
linkStart: '<a href="https://cloud.google.com/compute/docs/regions-zones/regions-zones" target="_blank" rel="noopener noreferrer">',
linkEnd: '</a>',
})
}}
```
其背后的原因是,在某些语言中,单词会根据上下文而变化. 例如,日语将は添加到句子的主语中,将を添加到宾语的主语中. 如果我们从句子中提取单个单词,则无法正确翻译.
如有疑问,请尝试遵循此[Mozilla Developer 文档中](https://s0developer0mozilla0org.icopy.site/en-US/docs/Mozilla/Localization/Localization_content_best_practices)描述的最佳做法.
##### Vue components interpolation[](#vue-components-interpolation "Permalink")
在 Vue 组件中翻译 UI 文本时,您可能希望在转换字符串中包括子组件. 您不能使用仅 JavaScript 的解决方案来呈现翻译,因为 Vue 不会意识到子组件并将其呈现为纯文本.
对于此用例,应使用在**GitLab UI 中**维护的`gl-sprintf`组件.
`gl-sprintf`组件接受`message`属性,该属性是可翻译的字符串,并且为字符串中的每个占位符公开一个命名的插槽,这使您可以轻松地包含 Vue 组件.
假设您要打印`Pipeline %{pipelineId} triggered %{timeago} by %{author}`的可翻译字符串`Pipeline %{pipelineId} triggered %{timeago} by %{author}` . 要将`%{timeago}`和`%{author}`占位符替换为 Vue 组件,以下是使用`gl-sprintf` :
```
<template>
<div>
<gl-sprintf :message="__('Pipeline %{pipelineId} triggered %{timeago} by %{author}')">
<template #pipelineId>{{ pipeline.id }}</template>
<template #timeago>
<timeago :time="pipeline.triggerTime" />
</template>
<template #author>
<gl-avatar-labeled
:src="pipeline.triggeredBy.avatarPath"
:label="pipeline.triggeredBy.name"
/>
</template>
</gl-sprintf>
</div>
</template>
```
有关更多信息,请参见[`gl-sprintf`](https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-sprintf--default)文档.
## Updating the PO files with the new content[](#updating-the-po-files-with-the-new-content "Permalink")
现在,新内容已标记为要翻译,我们需要使用以下命令更新`locale/gitlab.pot`文件:
```
bin/rake gettext:regenerate
```
该命令将使用新外部化的字符串更新`locale/gitlab.pot`文件,并删除不再使用的任何字符串. 您应该检入此文件.一旦将更改保存在主文件中,它们将由[CrowdIn 提取](https://translate.gitlab.com)并显示以进行翻译.
我们不需要签入对`locale/[language]/gitlab.po`文件的任何更改. 当[来自 CrowdIn 的翻译合并](merging_translations.html)时,它们会自动更新.
如果`gitlab.pot`文件中存在合并冲突,则可以删除该文件并使用同一命令重新生成它.
### Validating PO files[](#validating-po-files "Permalink")
为了确保我们的翻译文件保持最新, `static-analysis`工作中有一个运行在 CI 上的 lint.
要在本地`rake gettext:lint` PO 文件中的调整,可以运行`rake gettext:lint` .
短绒将考虑以下因素:
* 有效的 PO 文件语法
* 可变用法
* 仅一个未命名( `%d` )变量,因为变量的顺序可能会以不同的语言更改
* 消息 ID 中使用的所有变量都在转换中使用
* 转换中不应使用消息 ID 中没有的变量
* 翻译时出错.
错误按文件和消息 ID 分组:
```
Errors in `locale/zh_HK/gitlab.po`:
PO-syntax errors
SimplePoParser::ParserErrorSyntax error in lines
Syntax error in msgctxt
Syntax error in msgid
Syntax error in msgstr
Syntax error in message_line
There should be only whitespace until the end of line after the double quote character of a message text.
Parsing result before error: '{:msgid=>["", "You are going to remove %{project_name_with_namespace}.\\n", "Removed project CANNOT be restored!\\n", "Are you ABSOLUTELY sure?"]}'
SimplePoParser filtered backtrace: SimplePoParser::ParserError
Errors in `locale/zh_TW/gitlab.po`:
1 pipeline
<%d 條流水線> is using unknown variables: [%d]
Failure translating to zh_TW with []: too few arguments
```
在此输出中, `locale/zh_HK/gitlab.po`具有语法错误. `locale/zh_TW/gitlab.po`具有转换中使用的变量,这些变量不在 ID `1 pipeline`的消息中.
## Adding a new language[](#adding-a-new-language "Permalink")
假设您想添加一种新语言的翻译,例如法语.
1. 第一步是在`lib/gitlab/i18n.rb`注册新语言:
```
...
AVAILABLE_LANGUAGES = {
...,
'fr' => 'Français'
}.freeze
...
```
2. 接下来,您需要添加语言:
```
bin/rake gettext:add_language[fr]
```
如果要为特定区域添加新语言,则命令类似,您只需要用下划线( `_` )分隔区域即可. 例如:
```
bin/rake gettext:add_language[en_GB]
```
请注意,您需要在大写字母中指定地区部分.
3. 现在已经添加了该语言,已经在以下路径下创建了一个新目录: `locale/fr/` . 现在,您可以开始使用 PO 编辑器来编辑位于`locale/fr/gitlab.edit.po`的 PO 文件.
4. 更新完翻译后,您需要处理 PO 文件以生成二进制 MO 文件,最后更新包含翻译的 JSON 文件:
```
bin/rake gettext:compile
```
5. 为了查看翻译后的内容,我们需要更改首选语言,该语言可以在用户的**设置** ( `/profile` )下找到.
6. 在确认更改没问题之后,您可以继续提交新文件. 例如:
```
git add locale/fr/ app/assets/javascripts/locale/fr/
git commit -m "Add French translations for Value Stream Analytics page"
```
- GitLab Docs
- Installation
- Requirements
- GitLab cloud native Helm Chart
- Install GitLab with Docker
- Installation from source
- Install GitLab on Microsoft Azure
- Installing GitLab on Google Cloud Platform
- Installing GitLab on Amazon Web Services (AWS)
- Analytics
- Code Review Analytics
- Productivity Analytics
- Value Stream Analytics
- Kubernetes clusters
- Adding and removing Kubernetes clusters
- Adding EKS clusters
- Adding GKE clusters
- Group-level Kubernetes clusters
- Instance-level Kubernetes clusters
- Canary Deployments
- Cluster Environments
- Deploy Boards
- GitLab Managed Apps
- Crossplane configuration
- Cluster management project (alpha)
- Kubernetes Logs
- Runbooks
- Serverless
- Deploying AWS Lambda function using GitLab CI/CD
- Securing your deployed applications
- Groups
- Contribution Analytics
- Custom group-level project templates
- Epics
- Manage epics
- Group Import/Export
- Insights
- Issues Analytics
- Iterations
- Public access
- SAML SSO for GitLab.com groups
- SCIM provisioning using SAML SSO for GitLab.com groups
- Subgroups
- Roadmap
- Projects
- GitLab Secure
- Security Configuration
- Container Scanning
- Dependency Scanning
- Dependency List
- Static Application Security Testing (SAST)
- Secret Detection
- Dynamic Application Security Testing (DAST)
- GitLab Security Dashboard
- Offline environments
- Standalone Vulnerability pages
- Security scanner integration
- Badges
- Bulk editing issues and merge requests at the project level
- Code Owners
- Compliance
- License Compliance
- Compliance Dashboard
- Create a project
- Description templates
- Deploy Keys
- Deploy Tokens
- File finder
- Project integrations
- Integrations
- Atlassian Bamboo CI Service
- Bugzilla Service
- Custom Issue Tracker service
- Discord Notifications service
- Enabling emails on push
- GitHub project integration
- Hangouts Chat service
- Atlassian HipChat
- Irker IRC Gateway
- GitLab Jira integration
- Mattermost Notifications Service
- Mattermost slash commands
- Microsoft Teams service
- Mock CI Service
- Prometheus integration
- Redmine Service
- Slack Notifications Service
- Slack slash commands
- GitLab Slack application
- Webhooks
- YouTrack Service
- Insights
- Issues
- Crosslinking Issues
- Design Management
- Confidential issues
- Due dates
- Issue Boards
- Issue Data and Actions
- Labels
- Managing issues
- Milestones
- Multiple Assignees for Issues
- Related issues
- Service Desk
- Sorting and ordering issue lists
- Issue weight
- Associate a Zoom meeting with an issue
- Merge requests
- Allow collaboration on merge requests across forks
- Merge Request Approvals
- Browser Performance Testing
- How to create a merge request
- Cherry-pick changes
- Code Quality
- Load Performance Testing
- Merge Request dependencies
- Fast-forward merge requests
- Merge when pipeline succeeds
- Merge request conflict resolution
- Reverting changes
- Reviewing and managing merge requests
- Squash and merge
- Merge requests versions
- Draft merge requests
- Members of a project
- Migrating projects to a GitLab instance
- Import your project from Bitbucket Cloud to GitLab
- Import your project from Bitbucket Server to GitLab
- Migrating from ClearCase
- Migrating from CVS
- Import your project from FogBugz to GitLab
- Gemnasium
- Import your project from GitHub to GitLab
- Project importing from GitLab.com to your private GitLab instance
- Import your project from Gitea to GitLab
- Import your Jira project issues to GitLab
- Migrating from Perforce Helix
- Import Phabricator tasks into a GitLab project
- Import multiple repositories by uploading a manifest file
- Import project from repo by URL
- Migrating from SVN to GitLab
- Migrating from TFVC to Git
- Push Options
- Releases
- Repository
- Branches
- Git Attributes
- File Locking
- Git file blame
- Git file history
- Repository mirroring
- Protected branches
- Protected tags
- Push Rules
- Reduce repository size
- Signing commits with GPG
- Syntax Highlighting
- GitLab Web Editor
- Web IDE
- Requirements Management
- Project settings
- Project import/export
- Project access tokens (Alpha)
- Share Projects with other Groups
- Snippets
- Static Site Editor
- Wiki
- Project operations
- Monitor metrics for your CI/CD environment
- Set up alerts for Prometheus metrics
- Embedding metric charts within GitLab-flavored Markdown
- Embedding Grafana charts
- Using the Metrics Dashboard
- Dashboard YAML properties
- Metrics dashboard settings
- Panel types for dashboards
- Using Variables
- Templating variables for metrics dashboards
- Prometheus Metrics library
- Monitoring AWS Resources
- Monitoring HAProxy
- Monitoring Kubernetes
- Monitoring NGINX
- Monitoring NGINX Ingress Controller
- Monitoring NGINX Ingress Controller with VTS metrics
- Alert Management
- Error Tracking
- Tracing
- Incident Management
- GitLab Status Page
- Feature Flags
- GitLab CI/CD
- GitLab CI/CD pipeline configuration reference
- GitLab CI/CD include examples
- Introduction to CI/CD with GitLab
- Getting started with GitLab CI/CD
- How to enable or disable GitLab CI/CD
- Using SSH keys with GitLab CI/CD
- Migrating from CircleCI
- Migrating from Jenkins
- Auto DevOps
- Getting started with Auto DevOps
- Requirements for Auto DevOps
- Customizing Auto DevOps
- Stages of Auto DevOps
- Upgrading PostgreSQL for Auto DevOps
- Cache dependencies in GitLab CI/CD
- GitLab ChatOps
- Cloud deployment
- Docker integration
- Building Docker images with GitLab CI/CD
- Using Docker images
- Building images with kaniko and GitLab CI/CD
- GitLab CI/CD environment variables
- Predefined environment variables reference
- Where variables can be used
- Deprecated GitLab CI/CD variables
- Environments and deployments
- Protected Environments
- GitLab CI/CD Examples
- Test a Clojure application with GitLab CI/CD
- Using Dpl as deployment tool
- Testing a Phoenix application with GitLab CI/CD
- End-to-end testing with GitLab CI/CD and WebdriverIO
- DevOps and Game Dev with GitLab CI/CD
- Deploy a Spring Boot application to Cloud Foundry with GitLab CI/CD
- How to deploy Maven projects to Artifactory with GitLab CI/CD
- Testing PHP projects
- Running Composer and NPM scripts with deployment via SCP in GitLab CI/CD
- Test and deploy Laravel applications with GitLab CI/CD and Envoy
- Test and deploy a Python application with GitLab CI/CD
- Test and deploy a Ruby application with GitLab CI/CD
- Test and deploy a Scala application to Heroku
- GitLab CI/CD for external repositories
- Using GitLab CI/CD with a Bitbucket Cloud repository
- Using GitLab CI/CD with a GitHub repository
- GitLab Pages
- GitLab Pages
- GitLab Pages domain names, URLs, and baseurls
- Create a GitLab Pages website from scratch
- Custom domains and SSL/TLS Certificates
- GitLab Pages integration with Let's Encrypt
- GitLab Pages Access Control
- Exploring GitLab Pages
- Incremental Rollouts with GitLab CI/CD
- Interactive Web Terminals
- Optimizing GitLab for large repositories
- Metrics Reports
- CI/CD pipelines
- Pipeline Architecture
- Directed Acyclic Graph
- Multi-project pipelines
- Parent-child pipelines
- Pipelines for Merge Requests
- Pipelines for Merged Results
- Merge Trains
- Job artifacts
- Pipeline schedules
- Pipeline settings
- Triggering pipelines through the API
- Review Apps
- Configuring GitLab Runners
- GitLab CI services examples
- Using MySQL
- Using PostgreSQL
- Using Redis
- Troubleshooting CI/CD
- GitLab Package Registry
- GitLab Container Registry
- Dependency Proxy
- GitLab Composer Repository
- GitLab Conan Repository
- GitLab Maven Repository
- GitLab NPM Registry
- GitLab NuGet Repository
- GitLab PyPi Repository
- API Docs
- API resources
- .gitignore API
- GitLab CI YMLs API
- Group and project access requests API
- Appearance API
- Applications API
- Audit Events API
- Avatar API
- Award Emoji API
- Project badges API
- Group badges API
- Branches API
- Broadcast Messages API
- Project clusters API
- Group clusters API
- Instance clusters API
- Commits API
- Container Registry API
- Custom Attributes API
- Dashboard annotations API
- Dependencies API
- Deploy Keys API
- Deployments API
- Discussions API
- Dockerfiles API
- Environments API
- Epics API
- Events
- Feature Flags API
- Feature flag user lists API
- Freeze Periods API
- Geo Nodes API
- Group Activity Analytics API
- Groups API
- Import API
- Issue Boards API
- Group Issue Boards API
- Issues API
- Epic Issues API
- Issues Statistics API
- Jobs API
- Keys API
- Labels API
- Group Labels API
- License
- Licenses API
- Issue links API
- Epic Links API
- Managed Licenses API
- Markdown API
- Group and project members API
- Merge request approvals API
- Merge requests API
- Project milestones API
- Group milestones API
- Namespaces API
- Notes API
- Notification settings API
- Packages API
- Pages domains API
- Pipeline schedules API
- Pipeline triggers API
- Pipelines API
- Project Aliases API
- Project import/export API
- Project repository storage moves API
- Project statistics API
- Project templates API
- Projects API
- Protected branches API
- Protected tags API
- Releases API
- Release links API
- Repositories API
- Repository files API
- Repository submodules API
- Resource label events API
- Resource milestone events API
- Resource weight events API
- Runners API
- SCIM API
- Search API
- Services API
- Application settings API
- Sidekiq Metrics API
- Snippets API
- Project snippets
- Application statistics API
- Suggest Changes API
- System hooks API
- Tags API
- Todos API
- Users API
- Project-level Variables API
- Group-level Variables API
- Version API
- Vulnerabilities API
- Vulnerability Findings API
- Wikis API
- GraphQL API
- Getting started with GitLab GraphQL API
- GraphQL API Resources
- API V3 to API V4
- Validate the .gitlab-ci.yml (API)
- User Docs
- Abuse reports
- User account
- Active sessions
- Deleting a User account
- Permissions
- Personal access tokens
- Profile preferences
- Threads
- GitLab and SSH keys
- GitLab integrations
- Git
- GitLab.com settings
- Infrastructure as code with Terraform and GitLab
- GitLab keyboard shortcuts
- GitLab Markdown
- AsciiDoc
- GitLab Notification Emails
- GitLab Quick Actions
- Autocomplete characters
- Reserved project and group names
- Search through GitLab
- Advanced Global Search
- Advanced Syntax Search
- Time Tracking
- GitLab To-Do List
- Administrator Docs
- Reference architectures
- Reference architecture: up to 1,000 users
- Reference architecture: up to 2,000 users
- Reference architecture: up to 3,000 users
- Reference architecture: up to 5,000 users
- Reference architecture: up to 10,000 users
- Reference architecture: up to 25,000 users
- Reference architecture: up to 50,000 users
- Troubleshooting a reference architecture set up
- Working with the bundled Consul service
- Configuring PostgreSQL for scaling
- Configuring GitLab application (Rails)
- Load Balancer for multi-node GitLab
- Configuring a Monitoring node for Scaling and High Availability
- NFS
- Working with the bundled PgBouncer service
- Configuring Redis for scaling
- Configuring Sidekiq
- Admin Area settings
- Continuous Integration and Deployment Admin settings
- Custom instance-level project templates
- Diff limits administration
- Enable and disable GitLab features deployed behind feature flags
- Geo nodes Admin Area
- GitLab Pages administration
- Health Check
- Job logs
- Labels administration
- Log system
- PlantUML & GitLab
- Repository checks
- Repository storage paths
- Repository storage types
- Account and limit settings
- Service templates
- System hooks
- Changing your time zone
- Uploads administration
- Abuse reports
- Activating and deactivating users
- Audit Events
- Blocking and unblocking users
- Broadcast Messages
- Elasticsearch integration
- Gitaly
- Gitaly Cluster
- Gitaly reference
- Monitoring GitLab
- Monitoring GitLab with Prometheus
- Performance Bar
- Usage statistics
- Object Storage
- Performing Operations in GitLab
- Cleaning up stale Redis sessions
- Fast lookup of authorized SSH keys in the database
- Filesystem Performance Benchmarking
- Moving repositories managed by GitLab
- Run multiple Sidekiq processes
- Sidekiq MemoryKiller
- Switching to Puma
- Understanding Unicorn and unicorn-worker-killer
- User lookup via OpenSSH's AuthorizedPrincipalsCommand
- GitLab Package Registry administration
- GitLab Container Registry administration
- Replication (Geo)
- Geo database replication
- Geo with external PostgreSQL instances
- Geo configuration
- Using a Geo Server
- Updating the Geo nodes
- Geo with Object storage
- Docker Registry for a secondary node
- Geo for multiple nodes
- Geo security review (Q&A)
- Location-aware Git remote URL with AWS Route53
- Tuning Geo
- Removing secondary Geo nodes
- Geo data types support
- Geo Frequently Asked Questions
- Geo Troubleshooting
- Geo validation tests
- Disaster Recovery (Geo)
- Disaster recovery for planned failover
- Bring a demoted primary node back online
- Automatic background verification
- Rake tasks
- Back up and restore GitLab
- Clean up
- Namespaces
- Maintenance Rake tasks
- Geo Rake Tasks
- GitHub import
- Import bare repositories
- Integrity check Rake task
- LDAP Rake tasks
- Listing repository directories
- Praefect Rake tasks
- Project import/export administration
- Repository storage Rake tasks
- Generate sample Prometheus data
- Uploads migrate Rake tasks
- Uploads sanitize Rake tasks
- User management
- Webhooks administration
- X.509 signatures
- Server hooks
- Static objects external storage
- Updating GitLab
- GitLab release and maintenance policy
- Security
- Password Storage
- Custom password length limits
- Restrict allowed SSH key technologies and minimum length
- Rate limits
- Webhooks and insecure internal web services
- Information exclusivity
- How to reset your root password
- How to unlock a locked user from the command line
- User File Uploads
- How we manage the TLS protocol CRIME vulnerability
- User email confirmation at sign-up
- Security of running jobs
- Proxying assets
- CI/CD Environment Variables
- Contributor and Development Docs
- Contribute to GitLab
- Community members & roles
- Implement design & UI elements
- Issues workflow
- Merge requests workflow
- Code Review Guidelines
- Style guides
- GitLab Architecture Overview
- CI/CD development documentation
- Database guides
- Database Review Guidelines
- Database Review Guidelines
- Migration Style Guide
- What requires downtime?
- Understanding EXPLAIN plans
- Rake tasks for developers
- Mass inserting Rails models
- GitLab Documentation guidelines
- Documentation Style Guide
- Documentation structure and template
- Documentation process
- Documentation site architecture
- Global navigation
- GitLab Docs monthly release process
- Telemetry Guide
- Usage Ping Guide
- Snowplow Guide
- Experiment Guide
- Feature flags in development of GitLab
- Feature flags process
- Developing with feature flags
- Feature flag controls
- Document features deployed behind feature flags
- Frontend Development Guidelines
- Accessibility & Readability
- Ajax
- Architecture
- Axios
- Design Patterns
- Frontend Development Process
- DropLab
- Emojis
- Filter
- Frontend FAQ
- GraphQL
- Icons and SVG Illustrations
- InputSetter
- Performance
- Principles
- Security
- Tooling
- Vuex
- Vue
- Geo (development)
- Geo self-service framework (alpha)
- Gitaly developers guide
- GitLab development style guides
- API style guide
- Go standards and style guidelines
- GraphQL API style guide
- Guidelines for shell commands in the GitLab codebase
- HTML style guide
- JavaScript style guide
- Migration Style Guide
- Newlines style guide
- Python Development Guidelines
- SCSS style guide
- Shell scripting standards and style guidelines
- Sidekiq debugging
- Sidekiq Style Guide
- SQL Query Guidelines
- Vue.js style guide
- Instrumenting Ruby code
- Testing standards and style guidelines
- Flaky tests
- Frontend testing standards and style guidelines
- GitLab tests in the Continuous Integration (CI) context
- Review Apps
- Smoke Tests
- Testing best practices
- Testing levels
- Testing Rails migrations at GitLab
- Testing Rake tasks
- End-to-end Testing
- Beginner's guide to writing end-to-end tests
- End-to-end testing Best Practices
- Dynamic Element Validation
- Flows in GitLab QA
- Page objects in GitLab QA
- Resource class in GitLab QA
- Style guide for writing end-to-end tests
- Testing with feature flags
- Translate GitLab to your language
- Internationalization for GitLab
- Translating GitLab
- Proofread Translations
- Merging translations from CrowdIn
- Value Stream Analytics development guide
- GitLab subscription
- Activate GitLab EE with a license