Skip to content

Commit

Permalink
Fix Suggest(...) functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
jefs42 committed Apr 29, 2022
1 parent 19fdc43 commit ce33a7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/LibreTranslate.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ public function translateFiles($file, $source = null, $target = null){
/*
@string $original Source text
@string $translation Suggested translation
@string $source Source language (optional, will use default/current source language)
@string $target Target language (optional, will use default/current target language)
*/
function Suggest($original, $suggestion, $source = null, $target = null) {
$data = [
Expand All @@ -218,6 +220,7 @@ function Suggest($original, $suggestion, $source = null, $target = null) {
if (!is_null($this->apiKey)) {
$data['api_key'] = $this->apiKey;
}
$data = http_build_query($data);
$response = $this->_doRequest('/suggest', $data);
if (is_object($response) && isset($response->success)) {
return $response->success;
Expand Down

0 comments on commit ce33a7b

Please sign in to comment.