|
@@ -727,7 +727,7 @@ class Translate |
|
@@ -727,7 +727,7 @@ class Translate |
|
727
|
* @return \Illuminate\Http\Client\Response
|
727
|
* @return \Illuminate\Http\Client\Response
|
|
728
|
* @time 2022/3/30 15:58
|
728
|
* @time 2022/3/30 15:58
|
|
729
|
*/
|
729
|
*/
|
|
730
|
- public static function translate($texts, $tls)
|
730
|
+ public static function translate($texts, $tls, $sl = 'auto')
|
|
731
|
{
|
731
|
{
|
|
732
|
$action = 'translates';
|
732
|
$action = 'translates';
|
|
733
|
if (is_string($texts)) {
|
733
|
if (is_string($texts)) {
|
|
@@ -738,7 +738,7 @@ class Translate |
|
@@ -738,7 +738,7 @@ class Translate |
|
738
|
}
|
738
|
}
|
|
739
|
$data = [
|
739
|
$data = [
|
|
740
|
'texts' => $texts,
|
740
|
'texts' => $texts,
|
|
741
|
- 'sl' => 'auto',
|
741
|
+ 'sl' => $sl,
|
|
742
|
'tls' => $tls,
|
742
|
'tls' => $tls,
|
|
743
|
];
|
743
|
];
|
|
744
|
return http_post(self::$url.$action, json_encode($data),self::$header);
|
744
|
return http_post(self::$url.$action, json_encode($data),self::$header);
|