Please note that currently this integration does not support self-hosted versions.

Azure Repos is a private Git repository cloud hosting that supports Team Foundation Version Control (TFVC).

Configuration

  • Open your Azure DevOps project and open Project settings in the bottom left corner.

  • Find Azure DevOps services section and enable the Repos service.

  • Now after refreshing the page, you should see the Repos tab in the left menu. Here you can add your project source code as usual.

  • Now proceed to Lokalise, open your translation project and click More > Integrations. Find Azure Repos integration and click Connect.

  • Click Connect again and then Authorize.

  • Sign in with your Microsoft account and allow access.

  • Now select your repository and a branch to use. Provide one or more platforms to include in exports.
    — Also decide whether you would like the filenames to include a full path. It is not needed in most cases, as you can configure the directory structure prefix at the pull request creation (export) step. However, when you have similar files in different subfolders, e.g. admin/locale.json and frontend/locale.json, you have to enable the Include path in the filenames option. Keep in mind that if you already have files uploaded to the project, including a path in the filenames at this step would mean that you are uploading different files.

  • Click Select files to pull.

  • Choose one or more translation files and adjust the detected languages as needed. Once you are ready, click Confirm.

As we recommend keeping all platform files within the same project, you may want to set up other repositories that apply to the same project. Click Add another repo to add more repositories.

Pulling files

Manual pull

Click Pull now to import translation files from your repo to Lokalise. Clicking this button will add the pull to the system queue to be executed in the background. You can check the process status by clicking Activity:

Alternatively, click Logs on the Azure integration page:

If you need to adjust the options, click Pull options on the integration page:

These options are similar to the ones presented on the Upload page.

Auto-pull

When you are satisfied with the initial pull results, it is a good idea to set up a webhook which automates pulling the changes to Lokalise as you push to your Azure repo.

To set up the auto-pull feature, open your Azure DevOps project and click Project settings in the bottom left corner. Then proceed to Service hooks and click Create subscription:

Choose Web Hooks from the list and click Next:

  • Choose Code pushed as a trigger event.

  • Choose your repository from the list.

  • Optionally, specify a desired branch and a group.

Click Next and provide the following:

  • URL — insert the Auto-pull URL from integration settings on Lokalise.

  • HTTP header — be X-Lokalise-Secret:{secret} , where {secret} is the Auto-pull secret from integration settings on Lokalise.

  • Provide other optional settings as needed.

  • Click Test to make sure your webhook works and then hit Finish to complete the setup.

Pull requests

To export translation files from Lokalise to the Azure repo, you have to create a new pull request. To achieve that, proceed to the Download page, adjust export options as needed and make sure to enable the Azure Repos trigger:

Optionally, choose one or more repositories from the Filter repositores dropdown and provide a custom Commit message. It is a good idea to use the Preview button first, so you can see the resulting file/folder structure before triggering the creation of a pull request.

To actually create a pull request on GitHub, you should press Build only (this way you won't download a translations bundle to your local PC). To check the status of the pull request creation, return to the Azure repos integration page and click the Logs button.

Here is what happens after you trigger a new PR:

  1. A new branch is created from the last revision of the branch you chose in the integration setup. The branch name would look like this: lokalise-2018-03-12_15-14-13 .

  2. A commit with all the files is created in the new branch.

  3. A pull request from the new branch to the previously chosen branch is created.

You may then review and merge a new pull request on Azure.

Did this answer your question?