1
This commit is contained in:
@@ -52,9 +52,9 @@ class TranslationJob
|
|||||||
foreach ($languages as $lang => $xflang) {
|
foreach ($languages as $lang => $xflang) {
|
||||||
|
|
||||||
if($entityType =='location'){
|
if($entityType =='location'){
|
||||||
// $fields = $translator->location($sourceFields,$lang,$sourceLang);
|
$fields = $translator->location($sourceFields,$lang,$sourceLang);
|
||||||
}else{
|
}else{
|
||||||
// $fields = $translator->vehicle($sourceFields,$lang,$sourceLang);
|
$fields = $translator->vehicle($sourceFields,$lang,$sourceLang);
|
||||||
}
|
}
|
||||||
|
|
||||||
$translationModel = $translationModels[$xflang];
|
$translationModel = $translationModels[$xflang];
|
||||||
@@ -64,7 +64,6 @@ class TranslationJob
|
|||||||
}else{
|
}else{
|
||||||
$translation = new $translationModel();
|
$translation = new $translationModel();
|
||||||
}
|
}
|
||||||
$fields = [];
|
|
||||||
$translation->fill($fields);
|
$translation->fill($fields);
|
||||||
$res = $translation->save();
|
$res = $translation->save();
|
||||||
log::info('$languages save '.$lang, [$res,$fields]);
|
log::info('$languages save '.$lang, [$res,$fields]);
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace app\util;
|
namespace app\util;
|
||||||
|
|
||||||
|
|
||||||
|
use support\Log;
|
||||||
|
|
||||||
class Xunfei
|
class Xunfei
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -113,6 +115,7 @@ digest: %s", "ntrans.xfyun.cn", $date, $digestBase64);
|
|||||||
try {
|
try {
|
||||||
$res = $this->xfyun($text, $from, $to);
|
$res = $this->xfyun($text, $from, $to);
|
||||||
$data = json_decode($res["body"], true);
|
$data = json_decode($res["body"], true);
|
||||||
|
log::info('fanyi',$data);
|
||||||
if ($data["code"] === 0) {
|
if ($data["code"] === 0) {
|
||||||
return $data["data"]["result"];
|
return $data["data"]["result"];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user