Esporta file

This method exports single translated files from Crowdin. Additionally, it can be applied to export XLIFF files for offline localization.


Nota:Usa la combinazione dell'identificatore del progetto e la chiave del progetto o la combinazione di identificatore del progetto, il nome utente e la chiave del profilo per superare questo endpoint.

Note: Exporting files from Crowdin you’ll receive an Etag identifier in response header. Store this identifier so you can use it next time exporting files. Add Etag identifier to the If-None-Match request header to see whether any changes were applied to the file. In case the file was changed it would be downloaded. If not you’ll receive a 304 (Not Modified) status code.


Nome Valore Descrizione
key required nella stringa Project API key
project-identifier required nella stringa Should contain the project identifier.
file required nella stringa This parameter specifies a path to the file that should be exported from the project.
lingua richiesta nella stringa Crowdin language code.
ramo opzionale nella stringa Il nome del ramo versione relativo (Versioni Gestione).
format optional nella stringa Specify xliff to export file in the XLIFF file format.
export_translated_only optional booleano 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. Valori accettabili sono: 1 o 0.
export_translated_files_only optional booleano Use this parameter if you want to get only translated files on export. Valori accettabili sono: 1 o 0.
export_approved_only optional booleano If set to 1 only approved translations will be exported in resulted file. Valori accettabili sono: 1 o 0.


#Download file in the same file format as source
wget -O de.xml "{project-identifier}/export-file?file=en.xml&language=de&key={project-key}"

#Download file for offline translation in XLIFF file format
wget -O de.xliff "{project-identifier}/export-file?file=en.html&format=xliff&language=de&key={project-key}"
ini_set('default_socket_timeout', 5); // socket timeout, just in case

$request_url = '{project-identifier}/export-file?file=en.html&format=xliff&language=de&key={project-key}';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$result = curl_exec($ch);

echo $result;

Questo articolo è stato utile?