torchv-translate 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/translate.js/translate.js +31 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "torchv-translate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Two lines of js realize automatic html translation. No need to change the page, no language configuration file, no API key, SEO friendly!",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
@@ -2184,27 +2184,37 @@ var translate = {
|
|
|
2184
2184
|
@param info 如果result为0,这里是失败信息
|
|
2185
2185
|
*/
|
|
2186
2186
|
isAllExecuteFinish:function(uuid, from, to, result, info){
|
|
2187
|
-
|
|
2188
|
-
translate.listener.execute.renderFinishByApiRun(uuid, from, to);
|
|
2189
|
-
|
|
2190
|
-
//通过 uuid、from 取得本次翻译相关的 texts、nodes , 触发 translateNetworkAfter_Trigger 钩子
|
|
2191
|
-
//获取请求日志
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
uuid
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2187
|
+
|
|
2188
|
+
translate.listener.execute.renderFinishByApiRun(uuid, from, to);
|
|
2189
|
+
|
|
2190
|
+
//通过 uuid、from 取得本次翻译相关的 texts、nodes , 触发 translateNetworkAfter_Trigger 钩子
|
|
2191
|
+
//获取请求日志
|
|
2192
|
+
if(typeof(translate.request) === 'object'
|
|
2193
|
+
&& typeof(translate.request.data) === 'object'
|
|
2194
|
+
&& typeof(translate.request.data[uuid]) === 'object'
|
|
2195
|
+
&& typeof(translate.request.data[uuid].list) === 'object'
|
|
2196
|
+
&& typeof(translate.request.data[uuid].list[from]) === 'object'
|
|
2197
|
+
&& typeof(translate.request.data[uuid].list[from][to]) === 'object'){
|
|
2198
|
+
var requestData = translate.request.data[uuid].list[from][to];
|
|
2199
|
+
translate.lifecycle.execute.translateNetworkAfter_Trigger({
|
|
2200
|
+
uuid: uuid,
|
|
2201
|
+
from: from,
|
|
2202
|
+
to: to,
|
|
2203
|
+
texts: requestData.texts,
|
|
2204
|
+
nodes: requestData.nodes,
|
|
2205
|
+
result: result,
|
|
2206
|
+
info: info
|
|
2207
|
+
});
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
//console.log('uuid:'+uuid+', from:'+from+', to:'+to);
|
|
2211
|
+
if(typeof(translate.translateRequest) !== 'object' || typeof(translate.translateRequest[uuid]) !== 'object'){
|
|
2212
|
+
return;
|
|
2213
|
+
}
|
|
2214
|
+
for(var lang in translate.translateRequest[uuid]){
|
|
2215
|
+
if (!translate.translateRequest[uuid].hasOwnProperty(lang)) {
|
|
2216
|
+
continue;
|
|
2217
|
+
}
|
|
2208
2218
|
if(translate.translateRequest[uuid][lang].executeFinish == 0){
|
|
2209
2219
|
//这个还没执行完,那么直接退出,不在向后执行了
|
|
2210
2220
|
//console.log('uuid:'+uuid+' lang:'+lang+' executeFinish:0 time:'+translate.translateRequest[uuid][lang][i][addtime]);
|