版本管理

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

分支

当几个人从事产品开发时,分支有助于管理不同的内容版本。 如果您有一个持续的项目,您可以向 Crowdin 添加项目分支,并允许翻译员在开发的同时翻译文本,以避免延误部署。

Crowdin 中的分支看起来就像标有特定图标的常规文件夹,并且对重复字符串有特定行为。
版本控制系统 (VCS) 和 Crowdin 的分支结构示例:

分支结构

创建分支

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

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

  • 将 Crowdin 项目与 GitLabGitHubBitbucketAzure Repos 集成。 推荐这个选项,因为在版本控制系统 (VCS) 中选择用于本地化的分支将自动在 Crowdin 中创建。
  • 使用 CLIAPI 添加新分支。
  • 手动创建分支。
使用 API 创建分支

要通过 API 创建分支,请使用“添加分支”方法。

使用 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. 打开您的项目并转到 原文 > 文件
  2. Click an arrow icon next to the needed branch to set the preferred priority.

重复项

由于分支是同一产品功能的不同版本,因此它们的本地化内容通常是重复的。 为了帮助翻译员一致地翻译版本并避免额外的翻译成本,我们提供了在版本分支内显示 选项,该选项允许仅在版本之间隐藏重复的字符串。 如果您的源文件包含具有明显标识符(键)的字符串,最好使用此选项的严格版本。 在其他情况下,请随意使用常规版本。

When this option is chosen, only the master strings first uploaded to the system should be translated. 所有重复的字符串将自动从主字符串获得译文。 Duplicates

推荐的工作流

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

  1. 使用任意一种可用方法将项目文件上传到 Crowdin 项目。
  2. 打开您的项目并前往 设置 > 导入 > 源字符串
  3. 重复字符串选项切换为 在版本分支内显示

The screenshot below visualizes how the workflow works in practice. 主分支分支 1分支 2 中的所有文本在出现后会立即传输到翻译服务器,即使这些分支尚未合并到 主分支

下载译文

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 下载译文

要使用 API 下载特定版本分支的译文,您可以使用以下 API 方法:

使用 CLI 下载译文

下载特定版本分支的译文:

$ crowdin download -b branch_name

合并分支

The Master branch will contain new texts from the Feature branches as soon as they are merged. 与 Crowdin 同步时,主分支中的文本会填充来自相应分支的译文。

将更新的主分支与 Crowdin 同步后,您可以从 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. 这样的测试部署允许您在需要时快速恢复到原始主分支版本。

另请参阅

本文是否有帮助?