Last active
April 19, 2019 16:07
-
-
Save rodionchernyshov/8cb3e272ed20226c9dc51d4f76e6c41c to your computer and use it in GitHub Desktop.
Qordoba Download Translation Code Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @category Qordoba PHP SDK | |
* @package Qordoba_Connector | |
* @copyright Copyright (c) 2018 | |
* @license https://www.qordoba.com/terms | |
*/ | |
require __DIR__ . '/../vendor/autoload.php'; | |
define('API_URL', 'https://app.qordoba.com/api'); | |
define('TARGET_LANGUAGE_CODE', 'ar-sa'); | |
$documentToTranslate = [ | |
'content' => [ | |
\Faker\Factory::create()->text(), | |
\Faker\Factory::create()->text(), | |
\Faker\Factory::create()->text(), | |
\Faker\Factory::create()->text(), | |
] | |
]; | |
$translationDocument = new Qordoba\Document( | |
API_URL, | |
'**********@mail.com', | |
'******', | |
0000, // Workspace ID | |
0000 // Organizaiotn ID | |
); | |
$translationDocument->setName('translation-document-unique-id'); | |
$translationDocument->setTag(\Qordoba\Interfaces\DocumentInterface::DEFAULT_TAG_NAME); | |
var_dump($translationDocument->fetchTranslation(TARGET_LANGUAGE_CODE)); | |
//array(1) { | |
// ["ar-sa"]=> array(4) { | |
// [0] => string(236) "منشوره voluptatem inventore OPTIO امات saepe الإهمال. Quis pariatur nesciunt blanditiis voluptates ناقص earum منشوره reiciendis. التحرير perspiciatis التسليم laudantium فيل ناقص accusamus." | |
// [1] => string(257) "Earum سينت فيل assumenda repudiandae نوبس maiores OMNIS mollitia. لا عقوبة quis quia repellendus voluptas laudantium الإدارة الخاصة fugit. Quas خامسة وآخرون موهبة الحقيقة. Quia quia التحرير ILLUM." | |
// [2] => string(259) "Asperiores explicabo الوضع التسليم مشروطا unde. وآخرون ااا recusandae laborum خامسة impedit. Aspernatur غير dolorem إعلان consequatur velit exercitationem. كوي consequuntur magnam occaecati excepturi آخرون في." | |
// [3]=> string(217) "Voluptas الدنيا خامسة voluptatem. نوستروم التسليم التسليم soluta velit التحرير eius quaerat necessitatibus. OPTIO Fugiat debitis سينت delectus aspernatur آخرون suscipit." | |
// } | |
//} | |
exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment