To get Version Control System integration working you have to specify which source files should be translated and how Crowdin should structure translated files in your repository.
Set the rules, according to which files that require translation will be filtered. In the Branch Configuration pop-up, Click Continue to set up the first rule.
The sample configuration provided on the screenshot has source and translation attributes containing standard wildcards (also known as globbing patterns) to make it easier to work with multiple files. Source files path: /doc/**/*.md makes Crowdin look for all the files with extention .md (*.md) in the main doc folder and all the folders that are stored within the root doc (**) folder.
Represents any character in 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 sub-path from source for a certain file. For example, you can use source: ‘/en/**/*.po’ to upload all *.po files to Crowdin recursively. The translation pattern will be ‘/%two_letters_code%/**/%original_file_name%’.
? (question mark)
Matches any single character.
Matches any single character in a set. Behaves exactly like character sets in Regexp, including set negation ([^a-z]).
Escapes the next metacharacter.
Use placeholders to identify where translated files will be placed and how they will be named:
|%language%||Language name (i.e. Ukrainian)|
|%two_letters_code%||Language code ISO 639-1 (i.e. uk)|
|%three_letters_code%||Language code ISO 639-2/T (i.e. ukr)|
|%locale%||Locale (like uk-UA)|
|%locale_with_underscore%||Locale (i.e. uk_UA)|
|%original_file_name%||Original file name|
|%android_code%||Android Locale identifier used to name "values-" directories|
|%osx_code%||OS X Locale identifier used to name ".lproj" directories|
|%original_path%||Take parent folders names in Crowdin project to build file path in resulted bundle|
|%file_extension%||Original file extension|
|%file_name%||File name without extension|
In case there are files that should not be translated, use the Ignored Pattern option and Crowdin won’t upload specific files for translation.
Often software projects have custom names for locale directories. You are allowed to map your own languages to be recognizable for Crowdin. To add language mapping, fulfill the Language Mapping section.
Define the structure of your file in the Scheme field. List the values in the necessary sequence using commas:
- identifier — the column contains a unique identifier of the source string
- source_phrase — this column contains the actual text that should be translated
- source_or_translation — Crowdin should consider the texts in this column as the source strings for translation and replace them with the translated texts when downloading the resulting file
- translation — the resulting translation files are placed in this column
- context — any contextual information that helps to better understand the meaning of the source strings
- max_length — defines the max. length of the translated texts
If a spreadsheet contains the translations for all target languages, you can use the option Multilingual spreadsheet. Also, indicate the sequence of columns with translations in the Scheme filed, for example: identifier,source_phrase,context,uk,ru,fr (Language Codes).
In case, you do not want the text that is included in the first row to be translated, check Import first line as header option.
Configuring XML Files
|Translate Content||Defines whether to translate texts placed inside the tags|
|Translate Attributes||Defines whether to translate tags attributes|
|Content Segmentation||Defines whether to split long texts into smaller text segments. |
Important! This option disables the possibility to upload existing translations for XML files when enabled.
|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]
There are several options that can not be configured online:
preserve_hierarchy- saves directory structure in Crowdin
dest- allows you to specify a file name in Crowdin
type- allows you to specify a file type in Crowdin
update_option- preserves translations and preserves/removes validations of changed strings during the file update
After saving online configuration, in the configured branch a crowdin.yaml file will be created. You can edit it manually adding necessary options.
Click Save to preview the created configuration.
Click Add File Filter in case you have various file groups with different configurations.
If there are several branches in the project that share the same configuration, and disparate filters should be applied to them, check Apply filters to all translatable branches.
Click Save to preserve created configuration.
After saving, the upload of localizable files to Crowdin will start.