Интеграция систем контроля версий: онлайн-настройка

To configure a version control system integration, specify the source files you’d like to translate and how Crowdin should structure the translated files in your repository.

Конфигурация ветки

Once you’ve selected your repository and branch for translation, the next step is to configure the selected branch. Click to open the Branch Configuration dialog and start the configuration. Click to open the Branch Configuration dialog and start the configuration.

Настройка интеграцииEnglish

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

Read more about configuring target file bundles for VCS integration.

Загрузка конфигурации

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

  1. Click and select Load configuration.
  2. Specify the name of the configuration file in your repository.
  3. Нажмите Продолжить.

Load configurationEnglish

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

Создание конфигурации

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

Branch configurationEnglish

Then specify the source and translated file paths using the 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’ve finished setting up the configuration for the selected branch and saved the changes, the configuration file will be saved in the root of the translation branch in your repository.

Шаблоны

* (asterisk)

Matches any character in the file or directory name. If you specify “*.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 subdirectories). Note that you can use ** in both the source and translation patterns. When you use ** in the translation pattern, it always includes a subpath from the source for a given file. For example, you can use source: ‘/en/**/*.po’ to recursively upload all *.po files to Crowdin. 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 specify where translated files will be placed and how they will be named:

Название Описание
%original_file_name% Исходное имя файла
%original_path% Take parent folder names in the Crowdin project to build file path in the resulting 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 используемый в названиях «values-» директорий
%osx_code% Локаль OS X, используемая для названий *.lproj" директорий
%osx_locale% OS X locale used to name translation resources (e.g., uk, zh-Hans, zh_HK)

Расширенные настройки

Игнорирование файлов

If you don’t want some files to be translated, click Add ignored pattern, specify the pattern for those files, and Crowdin will not upload those files for translation.

Ignore files or foldersEnglish

Сопоставление языка

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

To add a 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 create 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. If you upload 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 string translations. labels – column contains labels for the source strings. none – column that will be skipped during import.

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

If a spreadsheet contains the translations for several 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 filesEnglish

Настройка XML-файлов

XML FilesEnglish

Переводить контент Select to translate texts stored inside the tags.
Переводить атрибуты Select to translate tag attributes.
Сегментация контента Select to split the XML source file's content into shorter text segments.
Note: When Content segmentation is enabled, the translation upload is handled by an experimental machine learning technology.
Переводимые элементы This is an array of strings, where each item is the XPaths to the 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 - preserves the directory structure in Crowdin
  • Dest - позволяет задать имя файла в Crowdin
  • type - позволяет указать тип файла в Crowdin
  • update_option - keeps translations and keeps/removes approvals of changed strings during a file update
  • commit_message - additional commit message that can include Git tags
  • export_languages - экспорт переводов для указанных языков

Once you save the online configuration, a crowdin.yml file is saved in 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 to preview the created configuration.

Save configurationEnglish

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

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

Click Save to save the created configuration.

Apply filters to all translatable branchesEnglish

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

Sync in progress

Полезная информация

Была ли эта статья полезной?