Skip to content

Commit

Permalink
Add language detection support
Browse files Browse the repository at this point in the history
  • Loading branch information
davc0n committed Aug 23, 2022
1 parent 501a76e commit a18e21d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ModernMT.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ public function list_supported_languages() {
return $this->http->send('get', '/translate/languages');
}

/**
* @throws ModernMTException
*/
public function detect_language($q, $format = null) {
$data = [
'q' => $q,
'format' => $format
];

return $this->http->send('get', '/translate/detect', $data);
}

/**
* @throws ModernMTException
*/
Expand Down

0 comments on commit a18e21d

Please sign in to comment.