|
...
|
...
|
@@ -52,15 +52,9 @@ class TranslateLogic extends BaseLogic |
|
|
|
$info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]);
|
|
|
|
//获取当前URl的所有文本内容
|
|
|
|
$text_array = $this->getUrlRead($url);
|
|
|
|
if($this->user['project_id'] == 655){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($text_array, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
}
|
|
|
|
// 原始校对程序
|
|
|
|
$old_key = [];//key值组成数据
|
|
|
|
$data_read = json_decode($info ? $info['data'] : '',JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
|
|
if($this->user['project_id'] == 655){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data_read, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
}
|
|
|
|
if(!empty($data_read)){
|
|
|
|
foreach ($data_read as $k => $v){
|
|
|
|
$k = urldecode($k);
|
|
...
|
...
|
@@ -70,7 +64,10 @@ class TranslateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$arr2 = [];
|
|
|
|
foreach ($text_array as $val) {
|
|
|
|
if (FALSE == in_array($val, $old_key)){
|
|
|
|
if($val == ' '){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (FALSE == in_array(trim(urldecode($val),' '), $old_key)){
|
|
|
|
$arr2[] = $val;
|
|
|
|
}
|
|
|
|
}
|
...
|
...
|
|