GitLab Integration with PTC

+

Connect GitLab with PTC for continuous localization. Get translations delivered via automatic merge requests whenever your code changes.

How To Integrate GitLab with PTC

PTC connects to your GitLab repository and keeps your resource files translated as you work. Push changes to your code and PTC will automatically detect them, translate the updated strings, and open a merge request.

1

Connect Your GitLab Repository

PTC supports both GitLab.com and self-hosted GitLab repositories. Depending on where you are in your workflow, there are two ways to get started:

  • When creating a new project in PTC, select Git Integration in the setup wizard.
  • To switch an existing project from manual file uploads to a continuous Git-based workflow, go to Settings → Merge Requests and click Add Git Integration.

In both cases, you’ll see a screen where you can enter the URL to your project within the repository. PTC will automatically detect that you’re using GitLab.

2

Authenticate with GitLab

To connect your repository, you can use an access token (recommended) or sign in with OAuth. PTC supports both project access tokens and group access tokens.

PTC requires webhook access to detect changes in your repository. When using an access token, the role and scopes you need depend on how you want the webhook to be set up:

Automatic webhook setup

How it works

PTC creates and configures the webhook in GitLab on your behalf during the integration flow.

Creating the token

In your project, go to Settings → Access Tokens. Give the token a name, an optional description, and set an expiry date (recommended for security).

Required role

Maintainer

Scopes

api → Allows PTC to read from and push to the repository

Manual webhook setup

How it works

PTC provides you with a Callback URL and Secret Token. You create a webhook in your GitLab settings using these details, with Push events and Merge request events as triggers.

Creating the token

In your group, go to Settings → Access Tokens. Give the token a name, an optional description, and set an expiry date (recommended for security).

Required role

Developer (or equivalent)

Scopes

read_repository + write_repository

How it works

Creating the token

Required role

Scopes

Automatic webhook setup

PTC creates and configures the webhook in GitLab on your behalf during the integration flow.

In your project, go to Settings → Access Tokens. Give the token a name, an optional description, and set an expiry date (recommended for security).

Maintainer

api 

Manual webhook setup

PTC provides you with a Callback URL and Secret Token. You create a webhook in your GitLab settings using these details, with Push events and Merge request events as triggers.

In your project, go to Settings → Access Tokens. Give the token a name, an optional description, and set an expiry date (recommended for security).

Developer (or equivalent)

read_repository + write_repository

Store the token securely and add it to PTC. It will verify your permissions and let you choose which branches and resource files to monitor.

3

Translate Your Project with PTC

Once your GitLab repository is connected, continue through the setup steps to provide some context about your app or software and choose your target languages.

PTC will then translate the resource files in your connected GitLab branch. If your repository already contains translation files, PTC can detect and reuse them.

4

Review the Merge Request with Translations

PTC translates in minutes and sends a merge request with translations directly to your GitLab repo. Once you’re ready, simply merge it — no other action needed.

From that point on, as you push changes to your code, PTC will detect them and send new merge requests with updated translations, keeping your software fully localized over time.

Generate New Merge Requests Manually

In addition to automatic updates, you can generate a new merge request at any time to sync translations you’ve edited or retranslated.

To do this, go to the Translations tab. From here, you can review translated text that exceeds the length limit and either edit it manually or let PTC generate a shorter version. Once you’re done, click Generate MR to push the updated translations to your repository.

5

Give PTC Access to New Resource Files as You Add Them

If you add new resource files to your repository after the initial integration, you can ask PTC to check for them.

  1. Go to Settings → Monitored Files and click Rescan your repository. PTC will scan your repository and display any newly discovered files as drafts.
  2. Click the + icon next to a file to include it for translation, then click Save with translation to confirm.

To skip manual review entirely, select the Automatically include new translation files checkbox. From that point on, PTC will automatically pick up and monitor any new resource files it finds, without requiring you to confirm them.

To adjust other settings like monitored branches and languages, navigate through the Branch Management, Monitored Files, and Languages tabs.

Why Localize GitLab Projects with PTC

Automated File Translation

PTC automatically detects and translates your resource files, delivering translations via merge requests. You maintain control by using the GitLab workflow you already know and trust — and without the need to create any script.

Less Manual Work

PTC saves development time and speeds up releases by monitoring your repository and updating translation files as you push changes.

Improved Translation Accuracy

PTC eliminates the risk of human errors like misplaced keys or outdated translations. You get highly accurate and on-brand translations.

Frequently Asked Questions About the GitLab Integration

Scroll to Top