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.
Nome | Valore | Descrizione |
---|---|---|
name optional | nella stringa | Nome del progetto. |
languages optional | insieme | An array of language codes a project should be translate to. |
join_policy optional | nella stringa | Project join policy. Valori accettabili sono:
|
language_access_policy optional | nella stringa | Defines how project members can access target languages. Valori accettabili sono:
|
hide_duplicates optional | int | Defines whether duplicated strings should be displayed to translators or should be hidden and translated automatically. Valori accettabili sono:
|
export_translated_only optional | booleano | Defines whether only translated strings will be exported to the final file. We do not recommend to set this option if you have text (*.html, *.txt, *.docx etc.) documents in your project since it may damage resulted files. Valori accettabili sono: 1 o 0. |
export_approved_only optional | booleano | If set to 1 only approved translations will be exported in resulted ZIP file. Valori accettabili sono: 1 o 0. |
auto_translate_dialects optional | booleano | Untranslated strings of dialect will be translated automatically in exported file, leveraging translations from main language. Valori accettabili sono: 1 o 0. |
public_downloads optional | booleano | Defines whether "Download" button visible to everyone on Crowdin webpages. Valori accettabili sono: 1 o 0. |
use_global_tm optional | booleano | Defines if translations would be leveraged from Crowdin Global Translation Memory. When using this option any translations made in your project will be commited to Crowdin Global TM automatically. Valori accettabili sono: 1 o 0. |
logo optional | file | Project logo at Crowdin. |
cname optional | nella stringa | Custom domain name for Crowdin project. |
description optional | nella stringa | Descrizione del progetto. |
qa_checks optional | insieme | Defines whether the QA checks should be active in the project. As a key you must specify QA check parameter (An Overview of QA Check Parameters). Possible keys are:
Note! This option is available only for organization plans. |
webhook_file_translated optional | nella stringa | Open this URL when one of the project files is translated. Open this URL when one of the project files is translated. |
webhook_file_proofread optional | nella stringa | Open this URL when one of the project files is proofread. Open this URL when one of the project files is translated. |
webhook_project_translated optional | nella stringa | Open this URL when project translation is complete. URL will be opened with "project" - project identifier and "language" - language code. |
webhook_project_proofread optional | nella stringa | Open this URL when project proofreading is complete. URL will be opened with "project" - project identifier and "language" - language code. |
json opzionale | nella stringa | Potrebbe non contenere il valore. Definisce che la risposta dovrebbe essere in formato JSON. |
jsonp opzionale | nella stringa | Nome della funzione di callback. Definisce che la risposta dovrebbe essere in formato JSONP. |
Variabili | ||
identificatore-progetto | nella stringa | Identificatore progetto. |
accesso | nella stringa | Il tuo nome utente su Crowdin. |
chiave-profilo | nella stringa | La chiave API del tuo profilo. |
<?xml version="1.0" encoding="UTF-8"?>
<project>
<success>1</success>
<invitation>http://translate.example.com/project/test-project-api/invite</invitation>
<url>http://translate.example.com/project/test-project-api</url>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project>
<success>1</success>
<invitation>
<item>
<language>Ukrainian</language>
<translator>http://translate.example.com/project/test-project-api/invite?d=7585662585d5d32307d3937373</translator>
<proofreader>http://translate.example.com/project/test-project-api/invite?d=3585k635r4d5d32307d3937373</proofreader>
</item>
</invitation>
<url>https://crowdin.com/project/test-project-api</url>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<error>
<code>3</code>
<message>Chiave API non valida</message>
</error>
curl \
-F "logo=@logo.png" \
-F "name=new project name" \
-F "description=new project description" \
-F "cname=new.example.com" \
-F "languages[]=de" \
-F "languages[]=fr" \
-F "languages[]=zh-CN" \
-F "hide_duplicates=1" \
-F "export_approved_only=0" \
-F "public_downloads=1" \
-F "qa_checks[enabled]=1" \
https://api.crowdin.com/api/project/{project-identifier}/edit-project?login={username}&account-key={account-key}
<?php
$post_params = array();
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/edit-project?login={username}&account-key={account-key}';
$post_params['name'] = 'new project name';
$post_params['join_policy'] = 'open';
$post_params['languages[0]'] = 'fr';
$post_params['languages[1]'] = 'de';
$post_params['languages[2]'] = 'zh-CN';
$post_params['qa_checks[enabled]'] = 1;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
$result = curl_exec($ch);
curl_close($ch);
echo $result;