GitLab works like GitHub: connect your account, pick a repository, and Continuous Translations opens a merge request that adds what your repository needs.
Only organization owners and admins can connect GitLab, browse projects and link them.
Connect GitLab #
- Open Organization settings → Integrations.
- In the GitLab card choose Connect. You sign in to GitLab, approve the access, and come back.
- The card says “Connected as account”. Choose Add account for another connection, or Disconnect.
If the card says “Not set up on this server yet”, the GitLab integration has not been configured for this installation.
Everything is done as the person who connected: commits, merge requests and variables are attributed to that account. The account must be a maintainer of the GitLab project. If that person leaves GitLab or loses access, reconnect with another account.
Create a project from a repository #
Follow the steps for GitHub: From repository on the Projects page, pick the account and the repository, check the paths and languages, and choose Create project.
The app then:
- stores a project key as the masked CI/CD variable
CT_API_KEY. If GitLab refuses to mask it, the variable is stored unmasked and you get a warning, - creates the branch
ct/setupwithct.ymland.gitlab/ct.gitlab-ci.yml(the job), - adds an
includeof the job file to.gitlab-ci.yml, or creates the file. If your.gitlab-ci.ymlalready has aninclude:section it is left alone, and the merge request tells you to add the line, - opens a merge request.
Merge it, and every push sends your strings to Continuous Translations.
Merge requests and branches #
The setup adds a project webhook for merge request events. When a merge request from a branch of the same project is merged, the branch with the same name in Continuous Translations is merged into main. If the webhook cannot be created, for example because GitLab blocks webhooks to local addresses, you get a warning. Run ct merge <branch> in the pipeline of the default branch instead. See CLI commands.
Good to know #
- The detected layout is
<directory>/<language>.json, the same as for GitHub. For other layouts enter the paths yourself. - A repository belongs to one project.
- Removing the application on the GitLab side is noticed on the next call, not immediately.