The GitLab integration allows you to synchronize translations from your Crowdin project to GitLab repo.
In string-based projects, GitLab integration exclusively operates in the Target file bundles mode.
Target file bundles mode – generate and push translation files to your GitLab repository from the Crowdin project in the selected format. In this mode, integration pushes translation files and doesn’t sync sources from your repo. In this mode, integration pushes translation files and doesn’t sync sources from your repo.
All completed translations are collected into bundles and automatically pushed as a merge request to the l10n
branch in the GitLab repository.
In case the repository you need is private, and you have limited or no access to it, please ask the repository owner to provide you with an access token. Afterward, click Use personal access token and insert the token into the Token field and click Set Up Integration.
Na caixa de diálogo exibida, selecione seu repositório e branches que devem ser traduzidas.
GitLab integration in the Target File Bundles Mode will send the completed translations from your Crowdin project without pulling sources from your repo. So when selecting a repository and branches that should be translated, you specify where the integration should put the generated bundles with translations.
Read more about configuring target file bundles for VCS integration.
Ao trabalhar com integrações privadas (por exemplo, integrações com VCS auto-hospedado), você precisa adicionar endereços IP Crowdin dedicados à lista de permissões para garantir que ela funcione corretamente enquanto permanece seguro.
Read more about IP Addresses.
Quando as traduções são concluídas e seus idiomas estão prontos para serem lançados, o Crowdin envia a solicitação de mesclagem com as traduções para o seu sistema de controle de versão. Para cada branch que está em localização, o Crowdin cria um branch de serviço adicional com traduções. Não nos comprometemos diretamente com o branch mestre para que você possa verificar as traduções primeiro.
By default, _l10n__ is added to the created service branch name. Se necessário, você pode alterá-lo facilmente.
Há casos em que é necessário desativar temporariamente as traduções de serem enviadas para o repositório. In this situation, click Edit, clear Sync Schedule in the integration settings, and click Save. When ready to sync translations with the repo, select the Sync Schedule, and click Save.
A sincronização é processada a cada hora automaticamente. Se necessário, você pode alterar o intervalo de atualização nas configurações de integração. To configure the synchronization schedule – click Edit, scroll down to the Sync Schedule, set the preferred interval, and click Save.
Ao configurar a integração, você seleciona os branch de repositório existentes a serem adicionadas ao projeto Crowdin. Para adicionar branches futuros do GitLab ao Crowdin automaticamente, crie um padrão para os nomes dos branches nas configurações de integração.
Por exemplo, você adiciona um *recurso padrão nas configurações de integração do GitLab. Neste caso, serão adicionados ao projeto os branches futuros que contenham esta palavra no final do título.
Para adicionar um padrão para nomes de branches, siga estas etapas:
crowdin.yml
is the default file name that is used for automatically synchronized branches. To change the default settings, click Edit, specify the preferred name in the Default configuration file name field in the integration settings, and click Save.
If you don’t specify your custom configuration file name for automatically synchronized branches, and the integration doesn’t find a configuration file with the default name crowdin.yml
in the root of the branch, these branches will be marked in the integration settings with a red icon with an exclamation mark saying “Not Ready. Check the configuration”.
To make integration work in the Target file bundles mode, you need to select the required bundles that you want to push to your repository. If you see a red icon with an exclamation mark next to the service branch name, it means that you haven’t selected any content for synchronization.
There are two ways you can specify content for synchronization:
Este procedimento é o mesmo para todas as integrações com sistemas de controle de versão (VCS). Read more about configuring target file bundles for VCS integration.
The configuration file crowdin.yml
should be placed in the GitLab repository along with each separate branch you want to push translations to, so that Crowdin knows exactly which translation bundles to send to your repository.
Ele deve ter a mesma estrutura exigida para CLI, mas as credenciais do seu projeto não devem ser armazenadas no cabeçalho do arquivo por motivos de segurança.
Read more about creating a configuration file.
If you’re working with a multi-platform product that has versions for different operating systems, you may want to connect multiple repositories that store content for each operating system. Nesse caso, os recursos de localização (por exemplo, MTs, Glossários) e traduções poderiam ser utilizados de forma mais eficiente, reduzindo o tempo necessário para a localização do projeto.
Para adicionar outro repositório, siga estas etapas:
Once the integration is set up, all related information is stored in the Integrations tab > GitLab section.
Depois que a integração é conectada, as configurações podem ser atualizadas apenas pelo membro do projeto que a configurou. All project managers except the person who configured the integration will see the Edit button disabled with the following message when hovering over it: Integration was configured by {Full Name} ({username})
.
Por padrão, a sincronização é processada a cada hora automaticamente. If you need to launch the synchronization immediately – click Sync Now.
Alternatively, if you need to sync only one branch separately, click on the needed branch and select Sync branch.
Q: I have an application build configured to be triggered by every commit. Since Crowdin commits each translation file in a separate commit, how can I avoid unnecessary application builds triggered by commits from Crowdin?
A: Since VCS integrations in Crowdin use API to commit files but not Git, each file is committed separately.
Aqui estão algumas recomendações que podem ajudar a resolver situações semelhantes:
export_languages
option to skip commits from languages you’re not interested in yet. Read more about the Export languages parameter for VCS integrations.