All Collections
Integrations
Development
GitLab
GitLab: Auto-syncing and Management
GitLab: Auto-syncing and Management

Syncing content between Transifex and GitLab

Antonis Mylonas avatar
Written by Antonis Mylonas
Updated over a week ago

Syncing Existing Resources with GitLab

Suppose your localization process is ongoing, and your projects/resources have been established in Transifex. In that case, you can still leverage the GitLab integration to synchronize the content already present in Transifex with the files residing in GitLab. All you need to do is execute the following steps:

  • Locate the TX resources in your selected GitLab repository and branch.

  • Note the path of each resource in the GitLab repository,
    e.g.,
    https://gitlab.com/transifex/GitLab-Transifex-Integration/blob/master/source/product_A.json

  • Keep the following details separately:

    • Repository name, e.g., transifex/GitLab-Transifex-Integration

    • Branch name, e.g., master

    • The full path name of the resource, e.g., source/product_A.json

  • Construct a temporary text using the following pattern:

    gitlab#{full_repo_name}#{branch_name}#{source_file_path}


    e.g.

    gitlab#transifex/GitLab-Transifex-Integration#master#source/product_A.json


  • Generate a hash for this text using the md5 algorithm, e.g., 4e18446ca9ed69e98e4846aca5a1d816 (Tip: You can use an online generator, like https://www.md5hashgenerator.com/ )

  • Edit each resource's settings and add the generated hash as a slug.


Syncing content from GitLab

Syncing content from GitLab to Transifex happens either upon saving or updating the integration settings on the project level or automatically whenever new content is found on GitLab (after a commit on the branch associated with the integration).

When a syncing process is initiated, you will see that syncing is in progress from within the integration’s UI. Go to your Project settings > integrations tab under GitLab and click the "Manage" link. Remember that this process may take some time, depending on the number and size of the synced files.

The integration page will display an activity log of all syncing operations with GitLab. These logs allow you to identify any potential issues with particular files that may have failed to sync or could not be located.


Syncing content from Transifex

If the file format of a resource allows, a project maintainer or administrator can directly edit it in Transifex's editor, regardless of whether the resource came from a GitHub repository. This feature allows for quick corrections, such as fixing spelling or punctuation mistakes. Any changes made in Transifex are automatically synchronized back to GitHub, either as a new pull request (PR) or a direct commit to the original branch. Consequently, developers are relieved from the manual task of retrieving the updated resources from Transifex and pushing them to GitHub.

The integration's activity log will record this action.


Commit and PR messages from Transifex on GitLab.

Any commits or PRs opening due to the integration are happening from the GitLab user that authorized the application.

📝Note: If you are using a Microsoft Windows-based system and working with CRLF files, a limitation comes from GitLab that converts these files into LF, potentially affecting your workflow.

This known issue occurs only when synchronizing files using the GitLab API.

To overcome this limitation and maintain your file in CRLF format, follow these steps:

  1. Download the file from your repository using your Git client.

  2. Convert it to CRLF with your preferred text editor or IDE.

  3. Upload it back to your repository.


Checking the status of the GitLab integration

Sometimes, changes on the GitLab side can affect the GitLab integration and the synchronization with Transifex.

More specifically, if the configuration file in the GitLab repository is corrupt or absent or the linked branch is deleted, Transifex and GitLab will stop exchanging content. The owner of the integration, i.e., the project maintainer or administrator who installed it in a specific project, will receive notifications regarding the integration's health status in two ways:

  • When viewing the integration’s UI, the status indicator for the connection with the associated GitLab repository shifts from green to red.

  • The integration owner receives an automated email notification that prompts them to investigate the cause of the problem in the GitLab integration.


💡Tip

Looking for more help? Get support from our Transifex Community Forum!

Find answers or post to get help from Transifex Support and our Community.

Did this answer your question?