版本管理

Maintain an agile localization process and prevent translation delays for added texts or new product features. 将您的项目分支集成到 Crowdin 并允许翻译者立即访问所有新的文本。

分支

When several people work on product development, branches help manage different content versions. If you have a continuous project, you can add project branches to Crowdin and allow translators to translate the texts in parallel with development to prevent deployment delays.

Branches in Crowdin look like regular folders marked with a specific icon and have special behavior for duplicate strings.
版本控制系统 (VCS) 和 Crowdin 的分支结构示例:

分支结构

创建分支

注意!您第一次上传到 Crowdin 项目的文件必须包含所有原始字符串,并且应该放在相应的分支中。 对于文中的示例,一个带有原始文本的分支命名为 Master

有几种方法可以添加分支到 Crowdin:

  • Integrate Crowdin projects with GitLab, GitHub, Bitbucket, or Azure Repos. 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.
使用 API 创建分支

To create a branch via API, use the Add Branch method.

使用 CLI 进行分支管理

If you use CLI, you can add and delete version branches with dedicated commands. Alternatively, you can create version branches during the file upload.

Read more about Branch Management with CLI.

调整分支优先级

You can set a specific priority for each branch by clicking an arrow icon next to the needed branch. Then translators will see branches sorted according to their priority on the language page and in the Editor.

各分支可能具有如下优先级:

  • 低优先级– 低优先级
  • 普通优先级– 中等优先级
  • 高优先级– 高优先级

要为您的分支设置优先级,请遵循以下步骤:

  1. Open your project and go to Sources > Files.
  2. Click an arrow icon next to the needed branch to set the preferred priority.

重复项

Because branches are different versions of the same product feature, their localization content is usually duplicated. To help translators translate versions consistently and avoid additional translation costs, we have the Show within a version branch option that allows hiding duplicated strings only between versions. If your source files contain strings with apparent identifiers (keys), it’s better to use a strict version of this option. In other cases, feel free to use a regular one.

When this option is chosen, only the master strings first uploaded to the system should be translated. All duplicated strings will automatically gain translations from the master strings. Duplicates

推荐的工作流

为了确保您的 Crowdin 项目能够顺利工作,我们推荐以下工作流:

  1. Upload your project files to the Crowdin project using one of the available methods.
  2. Open your project and go to Settings > Import > Source Strings.
  3. Switch the Duplicate Strings option to Show within a version branch.

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 from all version branches are placed in one ZIP archive when downloaded through the web interface. Use the CLI or API to download the translations for each branch individually.

使用 API 下载译文

To download translations of the specific version branch with API, you can use the following API methods:

使用 CLI 下载译文

Download translations of the specific version branch:

$ crowdin download -b branch_name

合并分支

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

After synchronizing the updated Master branch with Crowdin, you can remove the Feature branch from Crowdin. All translations stored in the Master branch will remain.

分支翻译验证

You can verify translations on production using only the Feature branch before changes are merged with your Master branch. Such test deployment allows you to quickly revert to the original Master branch version if needed.

另请参阅

本文是否有帮助?