Sprachstatus

Get the detailed translation progress for specified language.

Anfrage

Note: Either use the combination of project identifier and project key or combination of project identifier, username, and account key to pass to this endpoint.

POST https://api.crowdin.com/api/project/{Projektkennung}/language-status?key={Projektschlüssel}
POST https://api.crowdin.com/api/project/{Projekt-ID}/language-status?login={Nutzername}&account-key={Kontoschlüssel}

Parameter

Name Wert Beschreibung
Sprache erforderlich String Crowdin-Sprachcodes.
xml optional String May not contain value. Definiert, dass die Rückgabe im XML-Format sein soll. Default response type.
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
project-identifier String Projekt-ID.
project-key String Projekt-API-Schlüssel. Entweder project-key oder die Kombination aus login und account-key wird benötigt.
login String Ihr Nutzername auf Crowdin. Entweder project-key oder die Kombination aus login und account-key wird benötigt.
account-key String Your account API key. Entweder project-key oder die Kombination aus login und account-key wird benötigt.

Antwort

If successful, this method returns a XML structure, as it is shown below.
<?xml version="1.0" encoding="UTF-8"?>
<status>
  <files>
    <item>
      <node_type>directory</node_type>
      <id>29812</id>
      <name>Version 1.0</name>
      <files>
        <item>
          <node_type>file</node_type>
          <id>29827</id>
          <name>strings.xml</name>
          <node_type>file</node_type>
          <phrases>7</phrases>
          <translated>0</translated>
          <approved>0</approved>
          <words>32</words>
          <words_translated>0</words_translated>
          <words_approved>0</words_approved>
        </item>
      </files>
    </item>
    <item>
      <node_type>branch</node_type>
      <id>29824</id>
      <name>Version 2.0</name>
      <files>
        <item>
          <node_type>file</node_type>
          <id>29826</id>
          <name>strings.xml</name>
          <phrases>239</phrases>
          <translated>239</translated>
          <approved>10</approved>
          <words>1059</words>
          <words_translated>1059</words_translated>
          <words_approved>25</words_approved>
        </item>
      </files>
    </item>
    <item>
      <node_type>file</node_type>
      <id>29825</id>
      <name>description.txt</name>
      <phrases>1239</phrases>
      <translated>1239</translated>
      <approved>100</approved>
      <words>1990</words>
      <words_translated>1990</words_translated>
      <words_approved>309</words_approved>
    </item>
  </files>
</status>
Unsuccessful response sample:
<?xml version="1.0" encoding="UTF-8"?>
<error>
  <code>10</code>
  <message>Die Sprache wurde nicht gefunden</message>
</error>

Beispiele

curl \
  -F "language=fr" \
  https://api.crowdin.com/api/project/{Projekt-ID}/language-status?key={Projektschlüssel}
<?php
$request_url = 'https://api.crowdin.com/api/project/{project-identifier}/language-status?key={project-key}';

$post_params = array();
$post_params['language'] = 'fr';

$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?