GitLab integration to mirror translations to repo

Hello,

I’m trying to setup GitLab integration so that the latest Crowdin translations build is mirrored on a dedicate branch on my GitLab repo.

I thought the “Service Branch” feature of Crowdin’s GitLab integration app would do this, but I can’t get it to work.

I’ve setup the integration for SSS Translate dashboard in Crowdin using OAuth and I can sync and it reports no errors.

However syncing doesn’t push changes to the service branch (I’ve configured crowdin_translations_v1 to be the service branch), and no merge request is created.

This is the configuration file GitLab integration generated when I configured it:

I’ve tried with and without an existing crowdin_translations_v1 branch.


  1. What triggers updates to the “Service Branch”?

  2. Can the “Service Branch” be used to keep an up-to-date mirror of translations on my repo, or should I try another approach?

Hi @supersaiyansubtlety , could you please kindly send us the project link?

Both the Crowdin project and the GitLab project are linked in the OP.
(Last time I tried to re-post links my message was blocked).

Hi @supersaiyansubtlety looks like the integration wasn’t completely set up. Can you please try adding translations (+approvals since you have that export option) to the file and click on Sync now after you’re done?

That worked, thanks!

I checked these three options:


(I’m not actually sure if the last two are required)

One Two more questions:

  1. Is it possible to prevent the integration from creating a merge request?
  2. Is it possible to exclude empty files like this from the Service Branch?

Hello @supersaiyansubtlety!

The last two options are useful if you have some strings that do not translate into target languages, and since you have the export option of only the approved translations, you better do that as you upload the translations.

As for your questions: the merge request is automatically created after synchronization. I’m not sure which empty files you mean, but what gets exported can be set in the Export setting of the project and your configuration file.

  1. sounds like the answer is “no”, then; I guess I’ll use GitLab CI to automatically delete these merge requests
  2. these are my export settings:

I could check “Skip untranslated files”, but according to the description that would also exclude partially translated files, which I don’t want.

Where should I submit feature requests for these options?

@supersaiyansubtlety,

Export settings may work differently depending on the file format, and unfortunately, we can’t influence that. You may find more information about it here: Export Settings | Enterprise Docs

Thanks, looks like this is the intended behavior for json exports:

Untranslated strings exported with empty values
JSON (with nested structure)

I’d still like to request a GitLab integration option to disable automatic creation of merge requests. I don’t see anywhere to do that on https://store.crowdin.com/gitlab, is there somewhere else I could submit a request?

Hi @supersaiyansubtlety ,

Now there is really no way to avoid creating PR. You can turn off scheduled sync and sync only manually, and then the PR for the merge from the service branch to the main one will be created when you sync manually

As far as I understand, you want the translations to be simply exported to the service branch and not to create a PR for merging with the main branch at all. Now the only option is to simply close the PR. Could you share with us your use case and explain why you need this behavior?

I’m using the service branch as a source of up-to-date translations I can access without a personal token, so I can download them at runtime.

Hi @supersaiyansubtlety ,

Currently, there is no possibility to disable the creation of PRs, unfortunately. The only workaround is to disable the sync schedule and sync the integration manually.

Alright, thanks for the info.

FWIW, I also can’t currently export translations in the format I need even if I did want to merge the changes. I need file names to be %locale_with_underscore%, but all lowercase.

Oh it looks like I could with a language mapping configuration, but I’d have to map each language code to its lowercase equivalent manually.

Yes, you might use language mapping to do this

For example, Spanish → locale with underscore → es_es