目标文件包(基于字符串)

目标文件包或简称为文件包(Bundle)的功能允许您以您选择的格式导出字符串或文件集合,而不管原始文件格式如何。 默认情况下,您可以从以下三种格式中进行选择:XLIFF、Android XML 和 iOS 字符串。 You can add more target file formats by installing respective applications from the Crowdin Store.

You can work with bundles in several ways:

  • Manage bundles manually via the project’s Download tab.
  • Connect a VCS integration in Target file bundles mode. For string-based projects, this is the only mode that is selected by default.
  • 使用远程内容分发管理文件包。
  • 使用 Crowdin CLI 和 API 管理文件包。

When you work with bundles, the primary location for managing (creating, editing, and deleting) them is the project’s Download tab (for String-based projects). Once you’ve created a bundle, you can use it with all the aforementioned tools.

Use Cases

最常见的用例如下:

  • You can upload a single source file (e.g., Android XML) to your project, translate it, and then, using bundles, export translations for multiple platforms (e.g., Android XML for the Android app, iOS strings for the iOS app, JSON for the web app, etc.).
  • 您可以拥有一个电子表格(例如 XLSX 或 CSV),其中存储您的应用程序所针对的所有平台的源字符串,并且每个字符串都标有相应的标记。 将此文件上传到您的项目,进行翻译,然后使用源文件路径和字符串标记的组合为多个平台创建单独的文件包。
  • 通过组合 Crowdin 设计工具插件(Figma、Sketch、Adobe XD),您可以在没有源文件的情况下本地化您的移动应用程序,将字符串直接发送到 Crowdin 企业版项目,并使用文件包以首选格式导出译文。
  • 您可以以 XLIFF 格式导出特定的字符串集以进行离线翻译,然后将完成的译文上传回 Crowdin 企业版。

在“下载”选项卡中管理文件包

To work with bundles manually, you can configure and download them in your project’s Download tab.

配置文件包

要配置文件包,请按照下列步骤操作:

  1. Open your project and go to the Download tab.
  2. Click Target File Bundles to expand the respective section.
  3. Click Add bundle.
  4. 在出现的页面中,为您的文件包命名。
  5. Specify the source branches and resulting file paths. If needed, you can add multiple source branch path patterns using . In the right panel, you can preview the source branches and structure of the translation files based on the specified paths.
  6. (Optional) You can specify labels in the Filter by labels and Exclude by labels fields to filter strings, including or excluding them in the generated bundle.
  7. 选择您想要导出字符串的文件格式。 To add other formats, install the respective applications from our Store.
    Note: You can select only one format at once within a single bundle.
  8. (Optional) If a bundle file format has a icon, it indicates that it has additional options (e.g., Copy source to empty target and Export Translator’s Comments for XLIFF (system), Convert placeholders to target file format for Android XML (system), etc.) you may use when setting up your bundle. Click the icon on a selected bundle file format and configure it according to your preferences.
    配置文件包文件格式
  9. 单击 创建
    创建文件包

下载已配置的文件包

要下载已配置的文件包,请按照以下步骤操作:

  1. Open your project and go to the Download tab.
  2. Click Target File Bundles to expand the respective section.
  3. 单击 构建 以构建所需的包。
  4. 文件包构建活动完成后,单击 下载

下载文件包

系统将构建并下载一个 ZIP 档案,其中包含项目每种目标语言的文件夹,其中包含所选格式的翻译文件。

编辑文件包

要编辑已配置的文件包,请按照以下步骤操作:

  1. Open your project and go to the Download tab.
  2. Click Target File Bundles to expand the respective section.
  3. 单击所需文件包的 并选择 编辑。 或者,只需单击所需的文件包。
  4. Make the necessary edits and click Save.

编辑文件包

删除文件包

要删除文件包,请按以下步骤操作:

  1. Open your project and go to the Download tab.
  2. Click Target File Bundles to expand the respective section.
  3. 单击所需文件包的 并选择 删除
  4. Confirm the deletion by clicking Delete in the appeared dialog.

删除文件包

VCS 集成中的文件包

In string-based projects, VCS integrations exclusively operate in the Target file bundles mode.

To configure a VCS integration for Target file bundles mode, follow these steps:

  1. 单击 设置集成 并在 VCS 端授权与 Crowdin 企业版的连接后,选择您要向其发送译文的仓库和分支。
  2. Click to start the configuration of the selected branch.
  3. In the Branch Configuration dialog, specify the preferred name for your configuration file or leave it as is and click Continue.
  4. Select the needed bundles from the list or click Create new to create one from scratch.
  5. Once you’ve selected all the needed bundles in the Branch Configuration dialog, click Save.
  6. To complete the VCS integration configuration, click Save in the dialog where you selected your repo and branches.

VCS 目标文件包模式

详细了解 在线配置 VCS 集成

远程内容分发中的文件包

要添加使用文件包导出译文的分发,请按照以下步骤操作:

  1. Open your project and go to the Download tab.
  2. 单击 远程内容分发 以展开相应部分。
  3. Add new distribution using the Add distribution button.
  4. 在出现的对话框中,命名您的分发。
  5. Select the needed bundles from the list or click Create new to create one from scratch.
  6. 添加分发 对话框中选择了所有需要的文件包后,单击 创建
    远程内容分发文件包
  7. 复制分发哈希值,以便您可以用它进行集成。

详细了解 远程内容分发

CLI/API 中的文件包

使用 Crowdin CLI 和 API 时,您还可以使用文件包导出译文。

Read more about Bundles in CLI.

Read more about Bundles in API.

本文是否有帮助?