在线配置 VCS 集成

To configure a Version Control System integration, specify which source files should be translated and how Crowdin Enterprise should structure the translated files in your repository.

分支配置

Once you selected your repository and branch for translation, the next step you need to do is to configure the selected branch. Click to open the Branch Configuration dialog and start the configuration. In the Branch Configuration dialog, you can either load the existing configuration file stored on your repository or create a new configuration from scratch.

Integration set up

If you’d like your VCS integration to work in the Target File Bundles Mode, you need to configure target file bundles for each branch you selected for translation.

详细了解为 VCS 集成配置目标文件包

加载配置

To load the existing configuration file stored on your repository, follow these steps:

  1. Click Load configuration.
  2. Enter the name of the configuration file from your repository.
  3. 点击继续

Load configuration

The configuration will be displayed in the Branch Configuration dialog. You can use it as is or modify it if needed.

创建配置

To create a new configuration file that will be used by the integration, specify the preferred name and click Continue in the Branch Configuration dialog.

Branch configuration

Then specify the source and translated file paths using patterns and placeholders listed below. In the right panel, you can preview the structure of the source files that will be uploaded for translation and the structure of the translated files based on the specified paths.

Once you finish setting up the configuration for the selected branch and save the changes, the configuration file will be saved to the root of the translation branch in your repository.

模式

* (asterisk)

Represents any character in the file or directory name. If you specify a “*.json” it will include all files like “messages.json”, “about_us.json” and anything that ends with “.json”.

** (doubled asterisk)

Matches any string recursively (including sub-directories). Note that you can use ** in both source and translation patterns. When using ** in the translation pattern, it will always contain a sub-path from the source for a certain file. For example, you can use source: ‘/en/**/*.po’ to upload all *.po files to Crowdin Enterprise recursively. The translation pattern will be ‘/%two_letters_code%/**/%original_file_name%’.

? (question mark)

Matches any single character.

[set]

Matches any single character in a set. Behaves exactly like character sets in Regexp, including set negation ([^a-z]).

\ (backslash)

Escapes the next metacharacter.

占位符

Use placeholders to identify where translated files will be placed and how they will be named:

名称 描述
%original_file_name% 原始文件名
%original_path% Take parent folders names in Crowdin Enterprise project to build file path in the resulted bundle
%file_extension% 原始文件扩展名
%file_name% 不含有扩展名的文件名
%language% Language name (e.g., Ukrainian)
%two_letters_code% Language code ISO 639-1 (e.g., uk)
%three_letters_code% Language code ISO 639-2/T (e.g., ukr)
%locale% Locale (e.g., uk-UA)
%locale_with_underscore% Locale (e.g., uk_UA)
%android_code% Android Locale identifier used to name "values-" directories
%osx_code% OS X Locale identifier used to name ".lproj" directories
%osx_locale% OS X locale used to name translation resources (e.g., uk, zh-Hans, zh_HK)

高级设置

忽略文件

If some files shouldn’t be translated, select Ignore files or folders, specify the respective pattern for these files, and Crowdin Enterprise won’t upload specific files for translation.

Ignore files or folders

语言映射

If your project uses custom names for locale directories, you can use Language Mapping to map your own languages to be recognized by Crowdin Enterprise.

To add language mapping, follow these steps:

  1. Click Language mapping.
    Language mapping
  2. Select the necessary language and a placeholder.
  3. Specify your custom code.
  4. Click Add mapping to add another custom code.
  5. Click Save.
    Language mapping

配置电子表格

You can specify the scheme of your spreadsheet file in the Scheme field. To form the scheme for your CSV or XLS/XLSX file, use the following constants:

identifier – Column contains string identifiers.
source_phrase – Column contains source strings.
source_or_translation – Column contains source strings, but the same column will be filled with translations when the file is exported. When uploading existing translations, the values from this column will be used as translations.
translation – Column contains translations.
context – Column contains comments or context information for the source strings.
max_length – Column contains max.length limit values for the translations of the strings.
labels – Column contains labels for the source strings.
none – Column that will be skipped on import.

Scheme example: identifier,source_phrase,context,fr,de,it,uk (Language Codes).

If a spreadsheet contains the translations for multiple target languages, select Multilingual spreadsheet. If you don’t want to translate the text stored in the first row, select Import first line as a header.

Spreadsheet files

配置 XML 文件

XML Files

Translate Content Select to translate texts stored inside the tags.
Translate Attributes Select to translate tag attributes.
Content Segmentation Select to split the source XML file's content into shorter text segments.
Note: When Content segmentation is enabled, the translation upload is handled by an experimental machine learning technology.
Translatable Elements This is an array of strings, where each item is the XPaths to DOM element that should be imported.
Sample path: /path/to/node or /path/to/attribute[@attr]

额外参数

The following parameters can’t be configured online:

  • preserve_hierarchy - saves directory structure in Crowdin Enterprise
  • dest - allows you to specify a file name in Crowdin Enterprise
  • type - allows you to specify a file type in Crowdin Enterprise
  • update_option - keeps translations and keeps/removes approvals from the changed strings during the file update
  • commit_message - additional commit message that can include Git tags
  • export_languages - export translations for the specified languages

Once you save the online configuration, a crowdin.yml file will be saved to the root of the configured branch in your repository. You can edit this file manually to add the necessary parameters.

Read more about the configuration file.

保存配置

Click Save changes to preview the created configuration.

Save configuration

Click Add File Filter if you have various file groups with different configurations.

If several branches in the project share the same configuration, and the same filters should be applied to them, select Apply filters to all translatable branches.

Click Save to save the created configuration.

Apply filters to all the translatable branches

When the configuration is saved, the localizable files will start uploading to your Crowdin Enterprise project.

Sync in progress

另请参阅

本文是否有帮助?