Projekt erstellen

Ein Crowdin-Projekt erstellen.

Anfrage

POST https://api.crowdin.com/api/account/create-project?account-key={Kontoschlüssel}

Parameter

Name Wert Beschreibung
login benötigt String Ihr Crowdin-Konto-Anmeldename.
name benötigt String Projektname.
identifier benötigt String Project identifier. Should be unique among other Crowdin projects.
source_language benötigt String Source files language. Crowdin language code.
languages benötigt Array An array of language codes project should be translate to.
join_policy benötigt String Project join policy. Acceptable values are:
  • open
  • private
language_access_policy optional String Defines how project members can access target languages. Acceptable values are:
  • "open" - any translator can access any language. (default)
  • "moderate" - translator should be granted with access to certain language.
hide_duplicates optional Int. Defines whether duplicated strings should be displayed to translators or should be hidden and translated automatically. Acceptable values are:
  • 0 - Show – translators will translate each instance separately
  • 1 - Hide – all duplicates will share the same translation
  • 2 - Show, but auto-translate them
  • 3 - Show (recommended for versions) - duplicates will be hidden only between versions
export_translated_only optional Bool. 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. Zulässige Werte sind: „0” und „1”.
export_approved_only optional Bool. If set to 1 only approved translations will be exported in resulted ZIP file. Acceptable values are: 1 or 0.
auto_translate_dialects optional Bool. Untranslated strings of dialect will be translated automatically in exported file, leveraging translations from main language. Acceptable values are: 1 or 0.
public_downloads optional Bool. Defines whether "Download" button visible to everyone on Crowdin webpages. Acceptable values are: 1 or 0.
use_global_tm optional Bool. 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. Zulässige Werte sind: „0” und „1”.
logo optional file Projektlogo auf Crowdin.
cname optional String Custom domain name for Crowdin project.
description optional String Projektbeschreibung.
in_context optional Bool. Defines whether the In-Context should be active in the project. Acceptable values are: 1 or 0.
pseudo_language optional String Specify the language code for the In-Context's pseudo-language that will store some operational data.
qa_checks optional Array Defines whether the QA checks should be active in the project. As a key you must specify QA check parameter (Eine Übersicht aller QK-Parameter). Possible keys are:
  • „enabled“ — Qualitätskontrollen aktivieren
  • „empty“ — Leere Übersetzung
  • „size“ — Probleme mit der Länge
  • „tags“ — Tags stimmen nicht überein
  • „spaces“ — Leerzeichen stimmen nicht überein
  • „variables“ — Variablen stimmen nicht überein
  • „punctuation“ — Satzzeichen stimmen nicht überein
  • „symbol_register“ — Groß- und Kleinschreibung stimmen nicht überein
  • „special_symbols“ — Sonderzeichen stimmen nicht überein
  • „wrong_translation“ — „Fehlerhafte Übersetzung“-Probleme
  • „spellcheck” — Rechtschreibprüfung
  • „icu” — ICU-Syntax
Zulässige Werte sind: „0” und „1”.
Hinweis! This option is available only for organization plans.
webhook_file_translated optional String Open this URL when one of the project files is translated. URL will be opened with "project" - project identifier, "language" - language code, "file_id" - Crowdin file identifier and "file" - file name.
webhook_file_proofread optional String Open this URL when one of the project files is proofread. URL will be opened with "project" - project identifier, "language" - language code, "file_id" - Crowdin file identifier and "file" - file name.
webhook_project_translated optional String Open this URL when project translation is complete. URL will be opened with "project" - project identifier and "language" - language code.
webhook_project_proofread optional String Open this URL when project proofreading is complete. URL will be opened with "project" - project identifier and "language" - language code.
json optional String May not contain value. Defines that response should be in JSON format.
jsonp optional String Callback function name. Defines that response should be in JSONP format.
Variablen
account-key String Crowdin-Konto-API-Schlüssel.

Antwort

If the method is successful, it responds with an XML structure, as it is shown below (when language_access_policy = open).
<?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>
  <key>ca51cef8f852425496b1cdd3e86fea88</key>
</project>
Response example for projects with "Moderate" language_access_policy.
<?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>
  <key>d13720ba72204273af0321ca980945ec</key>
</project>
Unsuccessful response sample:
<?xml version="1.0" encoding="UTF-8"?>
<error>
  <code>12</code>
  <message>Der Kontoschlüssel ist ungültig</message>
</error>

Beispiele

curl \
  -F "login=admin" \
  -F "logo=@logo.png" \
  -F "name=Das ist ein Testprojekt" \
  -F "identifier=Testprojekt-API" \
  -F "description=Kurzbeschreibung" \
  -F "hide_duplicates=1" \
  -F "cname=translate.example.com" \
  -F "join_policy=open" \
  -F "languages[]=fr" \
  -F "languages[]=ru" \
  -F "export_approved_only=1" \
  -F "public_downloads=1" \
  -F "source_language=en" \
  -F "qa_checks[enabled]=1" \
  https://api.crowdin.com/api/account/create-project?account-key={Kontoschlüssel}
<?php
$post_params = array();
$request_url = 'https://api.crowdin.com/api/account/create-project?account-key={account-key}';
$post_params['login'] = 'admin';
$post_params['name'] = 'Test Project';
$post_params['identifier'] = 'api-test-project';
$post_params['join_policy'] = 'private';
$post_params['languages[0]'] = 'fr';
$post_params['languages[1]'] = 'uk';
$post_params['source_language'] = 'en';
$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;

War dieser Artikel hilfreich?