for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Crowdin API implementation in PHP.
*
* @copyright Copyright (C) 2016 Nikolai Plath (elkuku)
* @license GNU General Public License version 2 or later
*/
namespace ElKuKu\Crowdin\Package;
use ElKuKu\Crowdin\Package;
* Class Glossary
* @since 1.0.5
Class Glossary extends Package
{
* Download Crowdin project glossaries as TBX file.
* @param boolean $includeAssigned Defines whether the assigned glossaries should be included in downloaded TBX file.
* Acceptable values are: 0, 1.
* Default is 1.
* @see https://crowdin.com/page/api/download-glossary
* @return \Psr\Http\Message\ResponseInterface
public function download($includeAssigned = true)
return $this->getHttpClient()
->get($this->getBasePath('download-glossary') . '&include_assigned=' . (int) $includeAssigned);
}
* Upload your Translation Memory for Crowdin Project in TMX file format.
* @param string $file Full path to file to upload.
* @see https://crowdin.com/page/api/upload-glossary
public function upload($file)
if (false === file_exists($file))
throw new \UnexpectedValueException('File not found for upload');
$data = [[
'name' => 'file',
'contents' => fopen($file, 'r')
]];
->post($this->getBasePath('upload-glossary'), ['multipart' => $data]);