Gerenciamento de versões

Mantenha um processo de localização ágil e evite atrasos na tradução de textos adicionados ou novos recursos do produto. Integre as ramificações do seu projeto com o Crowdin e permita que os tradutores acessem imediatamente todos os novos textos.

Ramos

Quando várias pessoas estão trabalhando no desenvolvimento de produtos, as ramificações ajudam a gerenciar diferentes versões do conteúdo. Se você tiver um projeto contínuo, poderá adicionar ramificações ao Crowdin e permitir que os tradutores traduzam os textos em paralelo com o desenvolvimento, para evitar atrasos na implantação.

A ramificação no Crowdin parece uma pasta comum marcada com um ícone especial e possui um comportamento específico para sequências de caracteres duplicadas.
O exemplo de uma estrutura de arquivos no sistema de controle de versão (VCS) e Crowdin:

Branch Creation

Note! First files you upload to Crowdin project must contain all the original strings and should be placed in the corresponding branch. For all article examples a branch with original texts is named Master.

There are few ways to add branches to Crowdin: - Integrate Crowdin projects with GitLab, GitHub, or Bitbucket. It’s a recommended option, as branches selected for localization in your version control system (VCS) will be created in Crowdin automatically - Use CLI or API to add new branches - Create branches manually by going to Project Settings > Files > New Version Branch

Branch Creation using API

To create a branch via API, use the Add Directory method with is_branch=1 parameter:

POST https://api.crowdin.com/api/project/{project-identifier}/add-directory?key={project-key}&name={branch_name}&is_branch=1

Add File, Update File, Upload Translations and other methods that manipulate files and folders work with branch={branch_name} parameter.

Branch Management using CLI

There is no need to run a specific command to create version branches if the synchronization tool is used. The version branch would be created automatically while files uploading. Example of the source files/translations upload to the specified version branch:

$ crowdin upload sources -b branch_name

$ crowdin upload translations -b branch_name

Duplicates

Because branches are the different versions of the same product feature, the localization content in them is usually duplicated. To help translators translate versions consistently and avoid additional translation costs, we have a special option that allows hiding duplicated strings only between versions. When this option is chosen, only the original strings that were first uploaded to the system should be translated. All duplicated strings will automatically gain the translations from the original strings.

Duplicates

Suggested Workflow

To make sure versions work smoothly for your Crowdin project, we recommend the following workflow: 1. Upload your project files to Crowdin project using one of the methods available. 1. Go to Project Settings > Translations > Duplicates and choose the option recommended for versions.

The screenshot below visualizes how the workflow works in practice. All texts from Master, Branch 1 and Branch 2 are transferred to the translation server immediately after they appear, even though the branches are not merged to the Master branch yet.

Translations Export

Translations from all version branches are placed in one ZIP archive when they are downloaded through the web interface. Use the synchronization tool or API to download the translations for each branch individually.

Translations Export using API

Export translations of the specified version branch:

GET https://api.crowdin.com/api/project/{project-identifier}/export?key={project-key}&branch={branch_name}

Download translations of the specified version branch:

GET https://api.crowdin.com/api/project/{project-identifier}/download/{package}.zip?key={project-key}&branch={branch_name}
Translations Export using CLI

Download translations of the specified version branch:

$ crowdin download -b branch_name

Merging Branches

The Master branch will contain new texts from the Feature branches as soon as they are merged. While synchronizing with Crowdin, all of the texts in the Master branch are populated with translations from the appropriate branch.

After synchronization of the updated Master branch with Crowdin, the Feature branch can be removed from Crowdin. All translations stored in the Master branch will remain.

Branch Translation Verification

You can verify translations on production using only Feature branch before changes are merged with your Master branch. Such Test Deploy gives you an option of quick revert to the original Master branch version if needed.

Veja também

Este artigo foi útil?