Please consider that API 2.0 is now the preferred version to be used. The old API will remain fully functional until the end of 2021.
Название | Значение | Описание |
---|---|---|
file обязательный | строка | Этот параметр указывает путь к файлу, который нужно экспортировать из проекта. |
language обязательный | строка | языковой код Crowdin. |
branch необязательный | строка | Имя ветви связанной версии ( Управления версиями) ). |
format необязательный | строка | Укажите xliff для экспорта файла в XLIFF формат. |
export_translated_only необязательный | булево | Use this parameter if you want to get only translated strings in the exported file. We don't recommend to set this option if you have text (*.html, *.txt, *.docx etc.) documents in your project since it may damage resulted files. Допустимые значения: 1 или 0. |
export_translated_files_only optional | булево | Use this parameter if you want to get only translated files on export. Допустимые значения: 1 или 0. |
export_approved_only необязательный | булево | If set to 1 only approved translations will be exported in resulted file. Допустимые значения: 1 или 0. |
Variables | ||
project-identifier | строка | Идентификатор проекта. |
login | строка | Ваше имя пользователя в Crowdin. |
account-key | строка | API ключ вашего аккаунта. |
#Download file in the same file format as source
wget -O de.xml "https://api.crowdin.com/api/project/{project-identifier}/export-file?file=en.xml&language=de&login={username}&account-key={account-key}"
#Download file for offline translation in XLIFF file format
wget -O de.xliff "https://api.crowdin.com/api/project/{project-identifier}/export-file?file=en.html&format=xliff&language=de&login={username}&account-key={account-key}"
<?php
ini_set('default_socket_timeout', 5); // socket timeout, just in case
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/export-file?file=en.html&format=xliff&language=de&login={username}&account-key={account-key}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
echo $result;