Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
4 / 4 |
Language | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
4 / 4 |
getSupported | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
getStatus | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
<?php | |
/** | |
* Crowdin API implementation in PHP. | |
* | |
* @copyright Copyright (C) 2016 Nikolai Plath (elkuku) | |
* @license WTFPL - See license.txt | |
*/ | |
namespace ElKuKu\Crowdin\Package; | |
use ElKuKu\Crowdin\Package; | |
use Psr\Http\Message\ResponseInterface; | |
/** | |
* Class Language | |
* | |
* @since 1.0.5 | |
*/ | |
Class Language extends Package | |
{ | |
/** | |
* Get supported languages list with Crowdin codes mapped to locale name and standardized codes. | |
* | |
* @since 1.0.5 | |
* @see https://crowdin.com/page/api/supported-languages | |
* | |
* @return ResponseInterface | |
*/ | |
public function getSupported() : ResponseInterface | |
{ | |
return $this->getHttpClient() | |
->get('supported-languages'); | |
} | |
/** | |
* Get the detailed translation progress for specified language. | |
* | |
* @param string $language The language code. | |
* | |
* @since 1.0.5 | |
* @see https://crowdin.com/page/api/language-status | |
* | |
* @return ResponseInterface | |
*/ | |
public function getStatus(string $language) : ResponseInterface | |
{ | |
return $this->getHttpClient() | |
->post($this->getBasePath('language-status'), ['form_params' => ['language' => $language]]); | |
} | |
} |