2020-04-07 18:09:19 +00:00
# Merging translations from CrowdIn
2018-09-26 12:30:08 +00:00
2020-04-07 18:09:19 +00:00
CrowdIn automatically syncs the `gitlab.pot` file with the CrowdIn service, presenting
2019-10-25 03:06:02 +00:00
newly added externalized strings to the community of translators.
2018-09-26 12:30:08 +00:00
2020-04-07 18:09:19 +00:00
[GitLab CrowdIn Bot ](https://gitlab.com/gitlab-crowdin-bot ) also creates merge requests
2019-10-25 03:06:02 +00:00
to take newly approved translation submissions and merge them into the `locale/<language>/gitlab.po`
2020-02-06 15:09:11 +00:00
files. Check the [merge requests created by `gitlab-crowdin-bot` ](https://gitlab.com/gitlab-org/gitlab/-/merge_requests?scope=all&utf8=%E2%9C%93&state=opened&author_username=gitlab-crowdin-bot )
2019-10-22 15:06:06 +00:00
to see new and merged merge requests.
2018-09-26 12:30:08 +00:00
## Validation
2020-04-07 18:09:19 +00:00
By default CrowdIn commits translations with `[skip ci]` in the commit
2018-09-26 12:30:08 +00:00
message. This is done to avoid a bunch of pipelines being run. Before
merging translations, make sure to trigger a pipeline to validate
2020-04-07 18:09:19 +00:00
translations, we have static analysis validating things CrowdIn
2019-09-27 12:06:07 +00:00
doesn't do. Create a new pipeline at `https://gitlab.com/gitlab-org/gitlab/pipelines/new`
(need Developer access permissions) for the `master-i18n` branch.
2018-09-26 12:30:08 +00:00
If there are validation errors, the easiest solution is to disapprove
2020-04-07 18:09:19 +00:00
the offending string in CrowdIn, leaving a comment with what is
2018-09-26 12:30:08 +00:00
required to fix the offense. There is an
2020-05-21 06:08:25 +00:00
[issue ](https://gitlab.com/gitlab-org/gitlab/-/issues/23256 )
2018-09-26 12:30:08 +00:00
suggesting to automate this process. Disapproving will exclude the
invalid translation, the merge request will be updated within a few
minutes.
2020-04-07 18:09:19 +00:00
It might be handy to pause the integration on the CrowdIn side for a
2018-09-26 12:30:08 +00:00
little while so translations don't keep coming. This can be done by
2020-04-07 18:09:19 +00:00
clicking `Pause sync` on the [CrowdIn integration settings
2018-09-26 12:30:08 +00:00
page](https://translate.gitlab.com/project/gitlab-ee/settings#integration).
When all failures are resolved, the translations need to be double
2020-05-21 06:08:25 +00:00
checked once more as discussed in [confidential issue ](../../user/project/issues/confidential_issues.md ) `https://gitlab.com/gitlab-org/gitlab/-/issues/19485` .
2018-09-26 12:30:08 +00:00
## Merging translations
When all translations are found good and pipelines pass the
2019-10-25 03:06:02 +00:00
translations can be merged into the master branch. When merging the translations,
2020-04-07 18:09:19 +00:00
make sure to check the **Remove source branch** checkbox, so CrowdIn recreates the
2019-10-25 03:06:02 +00:00
`master-i18n` from master after the new translation was merged.
2018-09-26 12:30:08 +00:00
2020-05-21 06:08:25 +00:00
We are discussing [automating this entire process ](https://gitlab.com/gitlab-org/gitlab/-/issues/19896 ).
2018-09-26 12:30:08 +00:00
## Recreate the merge request
2020-04-07 18:09:19 +00:00
CrowdIn creates a new merge request as soon as the old one is closed
2018-09-26 12:30:08 +00:00
or merged. But it won't recreate the `master-i18n` branch every
2020-04-07 18:09:19 +00:00
time. To force CrowdIn to recreate the branch, close any [open merge
2020-02-06 15:09:11 +00:00
request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests?scope=all& utf8=%E2%9C%93& state=opened& author_username=gitlab-crowdin-bot)
2018-09-26 12:30:08 +00:00
and delete the
2019-09-27 12:06:07 +00:00
[`master-18n` ](https://gitlab.com/gitlab-org/gitlab/-/branches/all?utf8=✓&search=master-i18n ).
2018-09-26 12:30:08 +00:00
This might be needed when the merge request contains failures that
have been fixed on master.