translate-compiler
Advanced tools
Comparing version 0.8.0-beta to 0.8.2-beta
#! /usr/bin/env node | ||
const a0_0x39a010=a0_0x443b;(function(_0x29c8a8,_0x58729f){const _0x2a14e5=a0_0x443b,_0x228d8c=_0x29c8a8();while(!![]){try{const _0x56d8c6=-parseInt(_0x2a14e5(0x220))/0x1*(-parseInt(_0x2a14e5(0x238))/0x2)+parseInt(_0x2a14e5(0x1e0))/0x3*(-parseInt(_0x2a14e5(0x1f2))/0x4)+-parseInt(_0x2a14e5(0x211))/0x5+-parseInt(_0x2a14e5(0x1e9))/0x6+-parseInt(_0x2a14e5(0x242))/0x7*(-parseInt(_0x2a14e5(0x22b))/0x8)+-parseInt(_0x2a14e5(0x203))/0x9+parseInt(_0x2a14e5(0x1fa))/0xa*(parseInt(_0x2a14e5(0x1fc))/0xb);if(_0x56d8c6===_0x58729f)break;else _0x228d8c['push'](_0x228d8c['shift']());}catch(_0x94d069){_0x228d8c['push'](_0x228d8c['shift']());}}}(a0_0xcbf5,0xda7a1));const fs=require('fs'),path=require(a0_0x39a010(0x1dc)),{program}=require(a0_0x39a010(0x20c)),{pinyin}=require('pinyin-pro'),{translater}=require(a0_0x39a010(0x22c)),_path=process[a0_0x39a010(0x21d)]();function hasChinese(_0x1fe619){const _0x334fdb=a0_0x39a010;return/[\u4e00-\u9fa5]/g[_0x334fdb(0x1ea)](_0x1fe619);}let customLang={},config={'env':a0_0x39a010(0x1df),'locals':[],'excludes':[],'translate':[],'channel':'baidu','appKey':'','secretKey':'','suffix':a0_0x39a010(0x230),'output':a0_0x39a010(0x234)};getConfig();function getConfig(){const _0x5a7794=a0_0x39a010;program[_0x5a7794(0x1ec)](_0x5a7794(0x20a),_0x5a7794(0x205))['requiredOption'](_0x5a7794(0x200),'翻译的文件夹')[_0x5a7794(0x225)](_0x5a7794(0x218),_0x5a7794(0x207))[_0x5a7794(0x225)](_0x5a7794(0x23f),_0x5a7794(0x21c))['option']('--appKey\x20<value>',_0x5a7794(0x1e4))['option'](_0x5a7794(0x1f1),_0x5a7794(0x1e5))[_0x5a7794(0x225)](_0x5a7794(0x217),_0x5a7794(0x1ef))[_0x5a7794(0x225)](_0x5a7794(0x224),_0x5a7794(0x204))[_0x5a7794(0x225)]('-e,\x20--excludes\x20<value...>',_0x5a7794(0x214))[_0x5a7794(0x225)]('-o,\x20--output\x20<file>',_0x5a7794(0x240))[_0x5a7794(0x225)](_0x5a7794(0x215),_0x5a7794(0x206)),program[_0x5a7794(0x1d7)]();const _0x305f51=program[_0x5a7794(0x208)]();config=Object[_0x5a7794(0x222)](config,_0x305f51,{'env':program[_0x5a7794(0x233)][0x0]}),getFileContent(path['join'](_path,_0x5a7794(0x22f)),_0x3cf782=>{const _0x55f127=_0x5a7794;customLang=_0x3cf782,console[_0x55f127(0x20b)]('-\x20读取字典:\x20读取自定义字典\x27translate.json\x27成功!');},()=>{const _0x37b97c=_0x5a7794;console[_0x37b97c(0x20b)](_0x37b97c(0x22a));});}function getFileContent(_0x530785,_0x4c17f4,_0x10a3fd){const _0xb39c9b=a0_0x39a010;if(fs['existsSync'](_0x530785))try{let _0x123ddd=fs[_0xb39c9b(0x1ee)](_0x530785,{'encoding':_0xb39c9b(0x232)});const _0x550777=path[_0xb39c9b(0x227)](_0x530785);if(_0x550777==_0xb39c9b(0x1e8))_0x4c17f4&&_0x4c17f4(JSON[_0xb39c9b(0x1d7)](_0x123ddd));else{let _0x546eb0={};_0x123ddd[_0xb39c9b(0x23b)](/['"]*(\w+)['"]*:\s*"([^"]+)"/g,(_0x543be8,_0x2102fb,_0x2adc32)=>{_0x546eb0[_0x2102fb]=_0x2adc32;}),_0x4c17f4&&_0x4c17f4(_0x546eb0);}}catch(_0x25ded4){_0x10a3fd&&_0x10a3fd(_0xb39c9b(0x1f4));}else _0x10a3fd&&_0x10a3fd(_0xb39c9b(0x236));}function a0_0xcbf5(){const _0x5246a0=['locals','dev','390534xSCqYF','join','split','translate','翻译api\x20应用key','翻译api\x20密钥','forEach','-\x20执行文件:','.json','2478444UPAueN','test','match','argument','\x27)\x20}}','readFileSync','需要翻译的语言,对应locals','map','--secretKey\x20<value>','36GPJpfo','{{\x20$t(\x27','读取文件失败','this.$t(','this.$t(\x27','this.$t($key)','basename','parseInt','28698370wZArhs','toLowerCase','11hqCqNs','array','unlinkSync','readdirSync','-d,\x20--dir\x20<dir>','filter','excludes','7682175ULnlDN','翻译的文件名后缀,默认.vue','指定环境:dev(开发)/test(测试)/prod(生产),默认为开发环境','是否严格模式,\x20严格模式只提取$t()内中文,否则全局','需要生成的地区语言(语种代码)如:zh等','opts','fill','<env>','log','commander','.lang.$1','content','reduce','local.json','4492750UUGBVl','first','values','排除翻译的文件,可指定多个','--strict','\x20\x20\x22','-t,\x20--translate\x20<value...>','-l,\x20--locals\x20<value...>','strict','push','.lang','翻译渠道\x20baidu百度,youdao有道','cwd','keys','$t($key)','1036244rgDMTj','$t(','assign','output','-s,\x20--suffix\x20<value>','option','includes','extname','obj','env','-\x20读取字典:\x20未读取到自定义字典translate.json!','8kyYIbU','./parser/translater','dirname','isDirectory','/translate.json','.vue','hasOwnProperty','utf-8','args','locals/local.json','zh_cn','文件不存在','mkdirSync','2NEKDkv','lstatSync','length','replace','indexOf','none','\x27,\x20[','-c,\x20--channel\x20<value>','翻译结果写入路径,默认locals/local.json','writeFileSync','2279207OFYPtS','parse','??????FILE_NAME_TO_LONG','prod','existsSync','suffix','path','.js'];a0_0xcbf5=function(){return _0x5246a0;};return a0_0xcbf5();}function getSuffixFiles(_0x21b381,_0x3a4acd,_0x40fee9){const _0x242032=a0_0x39a010,_0x12f665=fs['readdirSync'](_0x21b381),_0xcadf32=[];return _0x12f665[_0x242032(0x1e6)]((_0x155f62,_0x269860)=>{const _0x4fe007=_0x242032,_0x22c6b8=path[_0x4fe007(0x1e1)](_0x21b381,_0x155f62),_0x174192=fs[_0x4fe007(0x239)](_0x22c6b8);if(_0x174192[_0x4fe007(0x22e)]())_0xcadf32[_0x4fe007(0x21a)](...getSuffixFiles(_0x22c6b8,_0x3a4acd,_0x40fee9));else path[_0x4fe007(0x227)](_0x155f62)==_0x3a4acd&&!_0x40fee9['includes'](path[_0x4fe007(0x227)](_0x155f62))&&_0xcadf32[_0x4fe007(0x21a)](_0x22c6b8);}),_0xcadf32;}function delSuffixFiles(_0x35e665,_0x42b3c2,_0x5ae079){const _0x2873ff=a0_0x39a010,_0x1117bf=fs[_0x2873ff(0x1ff)](_0x35e665);_0x1117bf[_0x2873ff(0x1e6)]((_0x209ff8,_0x435ca1)=>{const _0x422ca8=_0x2873ff,_0x4be59a=path[_0x422ca8(0x1e1)](_0x35e665,_0x209ff8),_0x537815=fs[_0x422ca8(0x239)](_0x4be59a),_0x1fd63e=new RegExp(_0x422ca8(0x21b)+_0x42b3c2+'$');if(_0x537815['isDirectory']())delSuffixFiles(_0x4be59a,_0x42b3c2,_0x5ae079);else _0x1fd63e[_0x422ca8(0x1ea)](_0x209ff8)&&!_0x5ae079['includes'](path[_0x422ca8(0x227)](_0x209ff8))&&fs[_0x422ca8(0x1fe)](_0x4be59a);});}function getTranslateKey(_0x51b13c,_0x1de71a){const _0x544802=a0_0x39a010;if(_0x1de71a[_0x544802(0x23a)]>0x28)return _0x544802(0x1d8);const _0x33029a=/^(['"`])|['"`]$/g,_0x42a11f=/\$*\{(.*?)\}/g;let _0x4b228c=_0x51b13c[_0x544802(0x23b)](_0x33029a,'');const _0x5ab64e=(_0x4b228c[_0x544802(0x1eb)](_0x42a11f)||[])[_0x544802(0x20f)]((_0x19f23d,_0x2a28d4,_0x808050)=>_0x19f23d[_0x544802(0x23b)](_0x2a28d4,'{'+_0x808050+'}'),_0x4b228c),_0xc23296=Object[_0x544802(0x213)](customLang)[_0x544802(0x23c)](_0x5ab64e);if(_0xc23296!==-0x1)return Object[_0x544802(0x21e)](customLang)[_0xc23296];_0x4b228c=_0x4b228c[_0x544802(0x23b)](_0x42a11f,'o'),_0x4b228c=_0x4b228c[_0x544802(0x23b)](/[^\u4e00-\u9fa5\w]/g,'');let _0x110214=_0x4b228c[_0x544802(0x23b)](/([\u4e00-\u9fa5]+)/g,_0x3e1478=>{const _0x13523d=_0x544802;return pinyin(_0x3e1478,{'toneType':'none','type':_0x13523d(0x1fd)})['join']('_');}),_0x2137fa=_0x1de71a+'_'+_0x110214;if(_0x2137fa[_0x544802(0x23a)]>0x1e){_0x110214=_0x4b228c['replace'](/([\u4e00-\u9fa5]+)/g,_0x4c2ca6=>{const _0x1da37d=_0x544802;return pinyin(_0x4c2ca6,{'pattern':_0x1da37d(0x212),'toneType':_0x1da37d(0x23d),'type':_0x1da37d(0x1fd)})[_0x1da37d(0x1e1)]('');}),_0x2137fa=_0x1de71a+'_'+_0x110214;if(_0x2137fa[_0x544802(0x23a)]>0x32){const _0xd72144=Number[_0x544802(0x1f9)](_0x110214[_0x544802(0x23a)]/(0x31-_0x1de71a[_0x544802(0x23a)]))+0x1;_0x110214=new Array(_0x110214[_0x544802(0x23a)])[_0x544802(0x209)]('')['reduce']((_0xbdd000,_0x4cd06e,_0x57afc6)=>''+_0xbdd000+(_0x57afc6%_0xd72144==0x0?_0x110214[_0x57afc6]:''));}_0x2137fa=_0x1de71a+'_'+_0x110214;}return _0x2137fa;}translate();function translate(){const _0x5a35f4=a0_0x39a010;delSuffixFiles(path[_0x5a35f4(0x1e1)](_path,config['dir']),config[_0x5a35f4(0x1db)],config[_0x5a35f4(0x202)]);const _0x1a398b=getSuffixFiles(path[_0x5a35f4(0x1e1)](_path,config['dir']),config[_0x5a35f4(0x1db)],config[_0x5a35f4(0x202)]);let _0x561b06={};_0x1a398b[_0x5a35f4(0x1e6)](function(_0x125a81,_0x4398fb){const _0x5c6956=_0x5a35f4;console['log'](_0x5c6956(0x1e7)+_0x125a81);let _0x511e2f=fs['readFileSync'](_0x125a81,{'encoding':_0x5c6956(0x232)})+'';const _0x443f1c=path[_0x5c6956(0x1f8)](_0x125a81)[_0x5c6956(0x1e2)]('.')[0x0],_0xe6c0d2=/\<template\>(.|\n|\r)*\<\/template\>/g,_0x3d50bb=/<!--[\s\S]*?-->/g,_0xddf850=/\<script\>(.|\n|\r)*\<\/script\>/g,_0x41dff8=/(?<=\s|\;|^|\{|\})\/\/[^\r\n]*/g,_0x497833=/\/\*[\s\S]*?\*\//g;_0x511e2f=_0x511e2f[_0x5c6956(0x23b)](_0xe6c0d2,_0xcf288c=>_0xcf288c['replace'](_0x3d50bb,'')),_0x511e2f=_0x511e2f[_0x5c6956(0x23b)](_0xddf850,_0x5c3225=>_0x5c3225[_0x5c6956(0x23b)](_0x41dff8,'')[_0x5c6956(0x23b)](_0x497833,''));const _0x491b39=/(?<=\$t\()(['"])(.*?)\1/g;_0x511e2f=_0x511e2f[_0x5c6956(0x23b)](_0x491b39,(_0x1e339f,_0x165717,_0x2e58e1)=>{if(hasChinese(_0x1e339f)){const _0x377212=getTranslateKey(_0x1e339f,_0x443f1c);return _0x561b06[_0x377212]=_0x2e58e1,'\x27'+_0x377212+'\x27';}return _0x1e339f;}),_0x511e2f=_0x511e2f[_0x5c6956(0x23b)](_0xe6c0d2,_0x364d30=>{const _0x152f85=_0x5c6956,_0x2f5c85=handleTemplate(_0x364d30,_0x443f1c);return _0x561b06=Object['assign'](_0x561b06,_0x2f5c85[_0x152f85(0x228)]),_0x2f5c85[_0x152f85(0x20e)];}),_0x511e2f=_0x511e2f[_0x5c6956(0x23b)](_0xddf850,_0x58763f=>{const _0x57346b=_0x5c6956,_0x13ec5f=handleScript(_0x58763f,_0x443f1c);return _0x561b06=Object[_0x57346b(0x222)](_0x561b06,_0x13ec5f['obj']),_0x13ec5f[_0x57346b(0x20e)];}),outputLangFile(_0x125a81,_0x511e2f);}),outputLocalFile(_0x561b06);}function handleTemplate(_0x31db6a,_0x206ec0){const _0x3fad1c=a0_0x39a010,_0x52b744=/<([a-z][a-z0-9\-]*)\b[^>]*>(.*?)<\/\1>/g,_0x2aace6=/(?<!\:)\b(?:\w|-)+\=(['"])(.*?)\1/g,_0x3fc81e=handleStringTpl(_0x31db6a,_0x206ec0,!![]);_0x31db6a=_0x3fc81e['content'];let _0x2c7fb9=_0x3fc81e['obj'];return!config[_0x3fad1c(0x219)]&&(_0x31db6a=_0x31db6a[_0x3fad1c(0x23b)](_0x52b744,(_0x368da5,_0x4dbc1a,_0x177093)=>{const _0x2bfb42=_0x3fad1c;if(hasChinese(_0x177093)){if(/\{\{(.*?)\}\}/g['test'](_0x177093)){const _0x931140=handleDoubleBrace(_0x177093,_0x206ec0,_0x2bfb42(0x21f),!![]);return _0x2c7fb9=Object[_0x2bfb42(0x222)](_0x2c7fb9,_0x931140['obj']),_0x368da5['replace'](_0x177093,_0x931140['content']);}const _0x517bdb=getTranslateKey(_0x177093,_0x206ec0);return _0x2c7fb9[_0x517bdb]=_0x177093,_0x368da5[_0x2bfb42(0x23b)](_0x177093,_0x2bfb42(0x1f3)+_0x517bdb+_0x2bfb42(0x1ed));}return _0x368da5;}),_0x31db6a=_0x31db6a[_0x3fad1c(0x23b)](_0x2aace6,(_0x260470,_0x78feb1,_0x31ce74)=>{const _0x1893be=_0x3fad1c;if(hasChinese(_0x31ce74)){const _0x2c755a=getTranslateKey(_0x31ce74,_0x206ec0);return _0x2c7fb9[_0x2c755a]=_0x31ce74,':'+_0x260470[_0x1893be(0x23b)](_0x31ce74,'$t(\x27'+_0x2c755a+'\x27)');}return _0x260470;})),{'content':_0x31db6a,'obj':_0x2c7fb9};}function a0_0x443b(_0x2463a9,_0x2e0066){const _0xcbf559=a0_0xcbf5();return a0_0x443b=function(_0x443bba,_0x25a000){_0x443bba=_0x443bba-0x1d7;let _0x3e9960=_0xcbf559[_0x443bba];return _0x3e9960;},a0_0x443b(_0x2463a9,_0x2e0066);}function handleScript(_0x3e7828,_0x1e043c){const _0x5144de=a0_0x39a010,_0x2d79b4=/(?<!\$t\(\s*)(['"])(.*?)(\1)/g,_0x1debbb=handleStringTpl(_0x3e7828,_0x1e043c);_0x3e7828=_0x1debbb[_0x5144de(0x20e)];let _0x3d0f0e=_0x1debbb[_0x5144de(0x228)];return!config[_0x5144de(0x219)]&&(_0x3e7828=_0x3e7828[_0x5144de(0x23b)](_0x2d79b4,(_0x2d5658,_0x2f2745,_0x53953c)=>{const _0x508e29=_0x5144de;if(hasChinese(_0x2d5658)){const _0x17d93c=getTranslateKey(_0x2d5658,_0x1e043c);return _0x3d0f0e[_0x17d93c]=_0x53953c,_0x508e29(0x1f6)+_0x17d93c+'\x27)';}return _0x2d5658;})),{'content':_0x3e7828,'obj':_0x3d0f0e};}function handleStringTpl(_0x59e3e3,_0x3a9254,_0x136fd6){const _0x431293=a0_0x39a010,_0x4282b3=/(?<!\$t\(\s*)`(.*?)`/g,_0x1407b4=/(?<=\$t\()`(.*?)`/g,_0x126f40=/\${(.*?)}/g;let _0x561a23={};const _0x5c9b50=function(_0x258851,_0x12c0c6,_0x9a23c){const _0x51e55b=a0_0x443b,_0x24c9f8=_0x258851[_0x51e55b(0x23b)](_0x126f40,'');if(hasChinese(_0x24c9f8)){const _0x4ce6cb=getTranslateKey(_0x258851,_0x3a9254),_0x2fbf4f=_0x258851['match'](_0x126f40);if(_0x2fbf4f){const _0x49043c=_0x2fbf4f['reduce']((_0x2d2885,_0x2bbae6,_0x97cb86)=>_0x2d2885[_0x51e55b(0x23b)](_0x2bbae6,'{'+_0x97cb86+'}'),_0x12c0c6),_0x1aea9c=_0x2fbf4f['map'](_0x3a7614=>{const _0x2c26cc=_0x51e55b,_0x49f64b=_0x3a7614[_0x2c26cc(0x23b)](_0x126f40,'$1'),_0x446e36=handleDoubleBrace(_0x49f64b,_0x3a9254,_0x136fd6?_0x2c26cc(0x21f):_0x2c26cc(0x1f7));return _0x561a23=Object[_0x2c26cc(0x222)](_0x561a23,_0x446e36[_0x2c26cc(0x228)]),_0x446e36[_0x2c26cc(0x20e)];});return _0x561a23[_0x4ce6cb]=_0x49043c,_0x9a23c('\x27'+_0x4ce6cb+_0x51e55b(0x23e)+_0x1aea9c[_0x51e55b(0x1e1)](',\x20')+']');}return _0x561a23[_0x4ce6cb]=_0x12c0c6,_0x9a23c('\x27'+_0x4ce6cb+'\x27');}return _0x258851;};return _0x59e3e3=_0x59e3e3[_0x431293(0x23b)](_0x1407b4,(_0xec6c1,_0xd1f27f)=>{return _0x5c9b50(_0xec6c1,_0xd1f27f,_0x333b2c=>_0x333b2c);}),!config[_0x431293(0x219)]&&(_0x59e3e3=_0x59e3e3[_0x431293(0x23b)](_0x4282b3,(_0x2c2fa6,_0x2a5c30)=>{const _0x397356=_0x431293;return _0x5c9b50(_0x2c2fa6,_0x2a5c30,_0xff8c99=>_0x136fd6?_0x397356(0x221)+_0xff8c99+')':_0x397356(0x1f5)+_0xff8c99+')');})),{'content':_0x59e3e3,'obj':_0x561a23};}function handleDoubleBrace(_0x1f9fdf,_0x5b8a62,_0x1c577f='$key',_0x3d3c87=![]){const _0x914fdc=a0_0x39a010,_0x339b34=/(['"])(.*?)(\1)/g;let _0x1dc64f={};if(_0x3d3c87){const _0xddbeae=(_0x1f9fdf['split'](/{{.*?}}/)||[])[_0x914fdc(0x201)](_0x3b9e01=>hasChinese(_0x3b9e01));_0xddbeae[_0x914fdc(0x1e6)](_0x3c0a19=>{const _0x447cee=_0x914fdc,_0x5dcf09=getTranslateKey(_0x3c0a19,_0x5b8a62);_0x1f9fdf=_0x1f9fdf['replace'](_0x3c0a19,_0x447cee(0x1f3)+_0x5dcf09+_0x447cee(0x1ed)),_0x1dc64f[_0x5dcf09]=_0x3c0a19;});}const _0x85d631=(_0x1f9fdf[_0x914fdc(0x1eb)](_0x339b34)||[])[_0x914fdc(0x201)](_0x29f97e=>hasChinese(_0x29f97e));return _0x85d631[_0x914fdc(0x1e6)](_0xa6e6d5=>{const _0x70580e=_0x914fdc,_0xdea187=getTranslateKey(_0xa6e6d5,_0x5b8a62);_0x1f9fdf=_0x1f9fdf[_0x70580e(0x23b)](_0xa6e6d5,_0x1c577f[_0x70580e(0x23b)]('$key','\x27'+_0xdea187+'\x27')),_0x1dc64f[_0xdea187]=_0xa6e6d5[_0x70580e(0x23b)](/^['"]|['"]$/g,'');}),{'content':_0x1f9fdf,'obj':_0x1dc64f};}function outputLangFile(_0x15da6f,_0x399ff2){const _0x5625a1=a0_0x39a010;if(config[_0x5625a1(0x229)]==_0x5625a1(0x1ea)){const _0x4e8cf4=_0x15da6f[_0x5625a1(0x23b)](/\.(\w+)$/,_0x5625a1(0x20d));fs[_0x5625a1(0x241)](_0x4e8cf4,_0x399ff2);}else config[_0x5625a1(0x229)]==_0x5625a1(0x1d9)&&fs[_0x5625a1(0x241)](_0x15da6f,_0x399ff2);}async function outputLocalFile(_0x1b99d2){const _0x4ad501=a0_0x39a010,_0x47db39=path[_0x4ad501(0x1e1)](_path,config[_0x4ad501(0x223)]);if(/\.\w+$/g[_0x4ad501(0x1ea)](_0x47db39)){const _0x259433=path[_0x4ad501(0x22d)](_0x47db39);!fs[_0x4ad501(0x1da)](_0x259433)&&fs[_0x4ad501(0x237)](_0x259433,{'recursive':!![]});const _0x31d949=path[_0x4ad501(0x227)](_0x47db39);handleLocalFile(_0x1b99d2,_0x47db39);for(let _0x5c772f=0x0;_0x5c772f<config['locals'][_0x4ad501(0x23a)];_0x5c772f++){const _0x48b769=config['locals'][_0x5c772f];if(_0x48b769=='zh'||_0x48b769[_0x4ad501(0x1fb)]()==_0x4ad501(0x235)){await handleLocalFile(_0x1b99d2,path[_0x4ad501(0x1e1)](path[_0x4ad501(0x22d)](_0x47db39),''+_0x48b769+_0x31d949));return;}await handleLocalFile(_0x1b99d2,path[_0x4ad501(0x1e1)](path[_0x4ad501(0x22d)](_0x47db39),''+_0x48b769+_0x31d949),_0x48b769,config[_0x4ad501(0x1e3)][_0x4ad501(0x226)](_0x48b769));}}else{!fs[_0x4ad501(0x1da)](_0x47db39)&&fs[_0x4ad501(0x237)](_0x47db39,{'recursive':!![]});handleLocalFile(_0x1b99d2,path[_0x4ad501(0x1e1)](_0x47db39,_0x4ad501(0x210)));for(let _0x38ca06=0x0;_0x38ca06<config['locals'][_0x4ad501(0x23a)];_0x38ca06++){const _0x1857e5=config[_0x4ad501(0x1de)][_0x38ca06];if(_0x1857e5=='zh'||_0x1857e5['toLowerCase']()==_0x4ad501(0x235)){await handleLocalFile(_0x1b99d2,path[_0x4ad501(0x1e1)](_0x47db39,_0x1857e5+'.json'));return;}await handleLocalFile(_0x1b99d2,path[_0x4ad501(0x1e1)](_0x47db39,_0x1857e5+_0x4ad501(0x1e8)),_0x1857e5,config[_0x4ad501(0x1e3)]['includes'](_0x1857e5));}}}async function handleLocalFile(_0x5484df,_0x5b2124,_0x1fd44d,_0x1e0848){const _0x116641=function(_0x47ee8f){const _0x27c1ee=a0_0x443b,_0x2e05e8=path[_0x27c1ee(0x227)](_0x5b2124);if(_0x2e05e8==_0x27c1ee(0x1dd)){let _0x10a514=Object[_0x27c1ee(0x21e)](_0x47ee8f)[_0x27c1ee(0x1f0)](_0x33bcba=>'\x20\x20'+_0x33bcba+':\x20\x22'+_0x47ee8f[_0x33bcba]+'\x22')[_0x27c1ee(0x1e1)](',\x0d');fs[_0x27c1ee(0x241)](_0x5b2124,'export\x20default\x20{\x0d'+_0x10a514+'\x0d}');}else{let _0x90e60c=Object['keys'](_0x47ee8f)[_0x27c1ee(0x1f0)](_0x2808e5=>_0x27c1ee(0x216)+_0x2808e5+'\x22:\x20\x22'+_0x47ee8f[_0x2808e5]+'\x22')[_0x27c1ee(0x1e1)](',\x0d');fs[_0x27c1ee(0x241)](_0x5b2124,'{\x0d'+_0x90e60c+'\x0d}');}};let _0x203926,_0x5223b3;getFileContent(_0x5b2124,_0x25b869=>{const _0x41c877=a0_0x443b;_0x203926=Object[_0x41c877(0x222)]({},_0x5484df,_0x25b869),_0x5223b3=getExtraValues(_0x5484df,_0x25b869);},()=>{const _0x436189=a0_0x443b;_0x203926=JSON[_0x436189(0x1d7)](JSON['stringify'](_0x5484df)),_0x5223b3=JSON['parse'](JSON['stringify'](_0x5484df));}),_0x1e0848?await translater(_0x5223b3,_0x1fd44d,config,_0x378693=>{const _0x40ac99=a0_0x443b;_0x203926=Object[_0x40ac99(0x222)](_0x203926,_0x378693),_0x116641(_0x203926);}):_0x116641(_0x203926);}function getExtraValues(_0x37ab97,_0x1b03ae){const _0x4917cf=a0_0x39a010,_0x96278c=Object[_0x4917cf(0x21e)](_0x37ab97)[_0x4917cf(0x201)](_0x18b3cb=>!_0x1b03ae[_0x4917cf(0x231)](_0x18b3cb)),_0x4a4dbd={};return _0x96278c['forEach'](_0x1f4eed=>{_0x4a4dbd[_0x1f4eed]=_0x37ab97[_0x1f4eed];}),_0x4a4dbd;} | ||
const a0_0x1089bc=a0_0x8de9;(function(_0xdd0ee5,_0x3c0e71){const _0xb5adb4=a0_0x8de9,_0xe4b052=_0xdd0ee5();while(!![]){try{const _0xd805ca=parseInt(_0xb5adb4(0xe9))/0x1+-parseInt(_0xb5adb4(0x13d))/0x2*(-parseInt(_0xb5adb4(0x10a))/0x3)+parseInt(_0xb5adb4(0x13c))/0x4+-parseInt(_0xb5adb4(0x138))/0x5*(-parseInt(_0xb5adb4(0x142))/0x6)+parseInt(_0xb5adb4(0xf2))/0x7*(-parseInt(_0xb5adb4(0x12f))/0x8)+-parseInt(_0xb5adb4(0x13b))/0x9+-parseInt(_0xb5adb4(0xf7))/0xa;if(_0xd805ca===_0x3c0e71)break;else _0xe4b052['push'](_0xe4b052['shift']());}catch(_0x4c2a2c){_0xe4b052['push'](_0xe4b052['shift']());}}}(a0_0x1dc2,0x9007d));const fs=require('fs'),path=require(a0_0x1089bc(0xdc)),{program}=require(a0_0x1089bc(0x112)),{pinyin}=require(a0_0x1089bc(0xda)),{translater}=require(a0_0x1089bc(0x132)),_path=process[a0_0x1089bc(0xfb)]();function hasChinese(_0x187069){const _0x313987=a0_0x1089bc;return/[\u4e00-\u9fa5]/g[_0x313987(0x117)](_0x187069);}let customLang={},config={'env':a0_0x1089bc(0x13e),'locals':[],'excludes':[],'translate':[],'channel':a0_0x1089bc(0xec),'appKey':'','secretKey':'','suffix':a0_0x1089bc(0x101),'output':a0_0x1089bc(0x10d)};getConfig();function a0_0x8de9(_0x2b364e,_0x53584f){const _0x1dc271=a0_0x1dc2();return a0_0x8de9=function(_0x8de920,_0x1798fe){_0x8de920=_0x8de920-0xd9;let _0xb16f7c=_0x1dc271[_0x8de920];return _0xb16f7c;},a0_0x8de9(_0x2b364e,_0x53584f);}function getConfig(){const _0x49f515=a0_0x1089bc;program['argument'](_0x49f515(0x106),_0x49f515(0xed))[_0x49f515(0x13a)]('-d,\x20--dir\x20<dir>',_0x49f515(0xf5))['option']('-l,\x20--locals\x20<value...>','需要生成的地区语言(语种代码)如:zh等')[_0x49f515(0x12a)](_0x49f515(0x102),_0x49f515(0x140))[_0x49f515(0x12a)](_0x49f515(0xdf),_0x49f515(0x134))['option'](_0x49f515(0xfa),'翻译api\x20密钥')[_0x49f515(0x12a)]('-t,\x20--translate\x20<value...>',_0x49f515(0x110))[_0x49f515(0x12a)](_0x49f515(0x11f),_0x49f515(0x130))[_0x49f515(0x12a)](_0x49f515(0xea),_0x49f515(0xe8))[_0x49f515(0x12a)](_0x49f515(0x120),_0x49f515(0x105))[_0x49f515(0x12a)](_0x49f515(0x126),_0x49f515(0x128)),program['parse']();const _0x48a416=program[_0x49f515(0x121)]();config=Object[_0x49f515(0x118)](config,_0x48a416,{'env':program[_0x49f515(0xd9)][0x0]}),getFileContent(path[_0x49f515(0x11c)](_path,'/translate.json'),_0x2b1101=>{const _0x280c5e=_0x49f515;customLang=_0x2b1101,console[_0x280c5e(0xe1)](_0x280c5e(0xeb));},()=>{const _0x298181=_0x49f515;console[_0x298181(0xe1)](_0x298181(0x13f));});}function getFileContent(_0x48a5c2,_0x1db91d,_0x346c23){const _0x6e0fe3=a0_0x1089bc;if(fs[_0x6e0fe3(0x10b)](_0x48a5c2))try{let _0x1b5fb7=fs[_0x6e0fe3(0xdd)](_0x48a5c2,{'encoding':'utf-8'});const _0xbf805b=path['extname'](_0x48a5c2);if(_0xbf805b=='.json')_0x1db91d&&_0x1db91d(JSON[_0x6e0fe3(0xfe)](_0x1b5fb7));else{let _0x5ade63={};_0x1b5fb7['replace'](/['"]*(\w+)['"]*:\s*"([^"]+)"/g,(_0x201c2c,_0x50c5b6,_0x4694cc)=>{_0x5ade63[_0x50c5b6]=_0x4694cc;}),_0x1db91d&&_0x1db91d(_0x5ade63);}}catch(_0x28f617){_0x346c23&&_0x346c23(_0x6e0fe3(0xe7));}else _0x346c23&&_0x346c23('文件不存在');}function getSuffixFiles(_0x560446,_0x4fd1fe,_0x46919e){const _0x258017=a0_0x1089bc,_0x45311d=fs[_0x258017(0x139)](_0x560446),_0x322af7=[];return _0x45311d[_0x258017(0xf4)]((_0x1d0de4,_0x42cba3)=>{const _0xf619a6=_0x258017,_0x4728c5=path[_0xf619a6(0x11c)](_0x560446,_0x1d0de4),_0x3de612=fs[_0xf619a6(0x12e)](_0x4728c5);if(_0x3de612[_0xf619a6(0x12b)]())_0x322af7[_0xf619a6(0xe4)](...getSuffixFiles(_0x4728c5,_0x4fd1fe,_0x46919e));else path[_0xf619a6(0xe2)](_0x1d0de4)==_0x4fd1fe&&!_0x46919e[_0xf619a6(0x119)](path['extname'](_0x1d0de4))&&_0x322af7[_0xf619a6(0xe4)](_0x4728c5);}),_0x322af7;}function delSuffixFiles(_0x2077ce,_0xc822cb,_0x286659){const _0x4894ce=fs['readdirSync'](_0x2077ce);_0x4894ce['forEach']((_0x44651d,_0x58bcc1)=>{const _0x50d345=a0_0x8de9,_0x59de2d=path[_0x50d345(0x11c)](_0x2077ce,_0x44651d),_0x4b0f45=fs[_0x50d345(0x12e)](_0x59de2d),_0x583244=new RegExp(_0x50d345(0x104)+_0xc822cb+'$');if(_0x4b0f45['isDirectory']())delSuffixFiles(_0x59de2d,_0xc822cb,_0x286659);else _0x583244['test'](_0x44651d)&&!_0x286659['includes'](path['extname'](_0x44651d))&&fs[_0x50d345(0x133)](_0x59de2d);});}function a0_0x1dc2(){const _0x1b0fd6=['requiredOption','2368350eXSgTY','4018924baJvAx','392dZZVfK','dev','-\x20读取字典:\x20未读取到自定义字典translate.json!','翻译渠道\x20baidu百度,youdao有道','\x27)\x20}}','1559202BDXZLI','basename','zh_cn','toLowerCase',':\x20\x22','args','pinyin-pro','values','path','readFileSync','indexOf','--appKey\x20<value>','dirname','log','extname','map','push','suffix','export\x20default\x20{\x0d','读取文件失败','排除翻译的文件,可指定多个','387313FquIyp','-e,\x20--excludes\x20<value...>','-\x20读取字典:\x20读取自定义字典\x27translate.json\x27成功!','baidu','指定环境:dev(开发)/test(测试)/prod(生产),默认为开发环境','replace','translate','\x20\x20\x22','??????FILE_NAME_TO_LONG','2338WkzFdy','excludes','forEach','翻译的文件夹','obj','15552060mSiLFn','parseInt','\x22:\x20\x22','--secretKey\x20<value>','cwd','-\x20执行文件:','keys','parse','dir','output','.vue','-c,\x20--channel\x20<value>','first','.lang','翻译结果写入路径,默认locals/local.json','<env>','-----------\x20中文字段统计频率排行榜,频率过高建议加入自定义key!','utf-8','filter','15018rUgXDa','existsSync','.js','locals/local.json','match','length','需要翻译的语言,对应locals','$key','commander','$t(\x27','this.$t(','prod','{{\x20$t(\x27','test','assign','includes','.lang.$1','strict','join','split','env','-s,\x20--suffix\x20<value>','-o,\x20--output\x20<file>','opts','.json','stringify','content','none','--strict','mkdirSync','是否严格模式,\x20严格模式只提取$t()内中文,否则全局','reduce','option','isDirectory','locals','writeFileSync','lstatSync','5384BpNqmE','翻译的文件名后缀,默认.vue','this.$t(\x27','./parser/translater','unlinkSync','翻译api\x20应用key','this.$t($key)','$t($key)','array','5cwDbTs','readdirSync'];a0_0x1dc2=function(){return _0x1b0fd6;};return a0_0x1dc2();}function getTranslateKey(_0x33add2,_0x47df17){const _0x2cd5a1=a0_0x1089bc;if(_0x47df17['length']>0x28)return _0x2cd5a1(0xf1);const _0x2ef67b=/^(['"`])|['"`]$/g,_0x35ef44=/\$*\{(.*?)\}/g;let _0x47948f=_0x33add2[_0x2cd5a1(0xee)](_0x2ef67b,'');const _0xd53fb0=(_0x47948f[_0x2cd5a1(0x10e)](_0x35ef44)||[])['reduce']((_0x55a792,_0x71f7b2,_0x177394)=>_0x55a792[_0x2cd5a1(0xee)](_0x71f7b2,'{'+_0x177394+'}'),_0x47948f),_0xd7bea7=Object[_0x2cd5a1(0xdb)](customLang)[_0x2cd5a1(0xde)](_0xd53fb0);if(_0xd7bea7!==-0x1)return Object[_0x2cd5a1(0xfd)](customLang)[_0xd7bea7];_0x47948f=_0x47948f[_0x2cd5a1(0xee)](_0x35ef44,'o'),_0x47948f=_0x47948f['replace'](/[^\u4e00-\u9fa5\w]/g,'');let _0x2a7620=_0x47948f[_0x2cd5a1(0xee)](/([\u4e00-\u9fa5]+)/g,_0x515ad6=>{const _0x3a0d76=_0x2cd5a1;return pinyin(_0x515ad6,{'toneType':_0x3a0d76(0x125),'type':_0x3a0d76(0x137)})[_0x3a0d76(0x11c)]('_');}),_0x355da3=_0x47df17+'_'+_0x2a7620;if(_0x355da3[_0x2cd5a1(0x10f)]>0x1e){_0x2a7620=_0x47948f[_0x2cd5a1(0xee)](/([\u4e00-\u9fa5]+)/g,_0x111caf=>{const _0x55369f=_0x2cd5a1;return pinyin(_0x111caf,{'pattern':_0x55369f(0x103),'toneType':_0x55369f(0x125),'type':_0x55369f(0x137)})[_0x55369f(0x11c)]('');}),_0x355da3=_0x47df17+'_'+_0x2a7620;if(_0x355da3['length']>0x32){const _0x512ac4=Number[_0x2cd5a1(0xf8)](_0x2a7620[_0x2cd5a1(0x10f)]/(0x31-_0x47df17[_0x2cd5a1(0x10f)]))+0x1;_0x2a7620=new Array(_0x2a7620['length'])['fill']('')[_0x2cd5a1(0x129)]((_0x1fcf85,_0x1530c0,_0x48dd42)=>''+_0x1fcf85+(_0x48dd42%_0x512ac4==0x0?_0x2a7620[_0x48dd42]:''));}_0x355da3=_0x47df17+'_'+_0x2a7620;}return _0x355da3;}translate();function translate(){const _0x29deaf=a0_0x1089bc;delSuffixFiles(path[_0x29deaf(0x11c)](_path,config[_0x29deaf(0xff)]),config['suffix'],config[_0x29deaf(0xf3)]);const _0x32ef6e=getSuffixFiles(path[_0x29deaf(0x11c)](_path,config[_0x29deaf(0xff)]),config[_0x29deaf(0xe5)],config['excludes']);let _0x335c8b={};_0x32ef6e['forEach'](function(_0x199dbe,_0x2c7b26){const _0x538d8d=_0x29deaf;console['log'](_0x538d8d(0xfc)+_0x199dbe);let _0x17e10c=fs[_0x538d8d(0xdd)](_0x199dbe,{'encoding':_0x538d8d(0x108)})+'';const _0x1e245a=path[_0x538d8d(0x143)](_0x199dbe)['split']('.')[0x0],_0x16c446=/\<template\>(.|\n|\r)*\<\/template\>/g,_0x325348=/<!--[\s\S]*?-->/g,_0x307e25=/\<script\>(.|\n|\r)*\<\/script\>/g,_0x589306=/(?<=\s|\;|^|\{|\})\/\/[^\r\n]*/g,_0x5e06f2=/\/\*[\s\S]*?\*\//g;_0x17e10c=_0x17e10c[_0x538d8d(0xee)](_0x16c446,_0x3740f2=>_0x3740f2['replace'](_0x325348,'')),_0x17e10c=_0x17e10c[_0x538d8d(0xee)](_0x307e25,_0x5a3752=>_0x5a3752[_0x538d8d(0xee)](_0x589306,'')[_0x538d8d(0xee)](_0x5e06f2,''));const _0x27c540=/(?<=\$t\()(['"])(.*?)\1/g;_0x17e10c=_0x17e10c['replace'](_0x27c540,(_0x387453,_0x350ab3,_0x326f33)=>{if(hasChinese(_0x387453)){const _0x5cadfc=getTranslateKey(_0x387453,_0x1e245a);return _0x335c8b[_0x5cadfc]=_0x326f33,'\x27'+_0x5cadfc+'\x27';}return _0x387453;}),_0x17e10c=_0x17e10c['replace'](_0x16c446,_0x583213=>{const _0x59d516=_0x538d8d,_0x4e7a5f=handleTemplate(_0x583213,_0x1e245a);return _0x335c8b=Object[_0x59d516(0x118)](_0x335c8b,_0x4e7a5f[_0x59d516(0xf6)]),_0x4e7a5f[_0x59d516(0x124)];}),_0x17e10c=_0x17e10c[_0x538d8d(0xee)](_0x307e25,_0x1d92e9=>{const _0x130f6c=_0x538d8d,_0x243ff3=handleScript(_0x1d92e9,_0x1e245a);return _0x335c8b=Object[_0x130f6c(0x118)](_0x335c8b,_0x243ff3[_0x130f6c(0xf6)]),_0x243ff3[_0x130f6c(0x124)];}),outputLangFile(_0x199dbe,_0x17e10c);}),outputLocalFile(_0x335c8b);}function handleTemplate(_0x405f19,_0xee52bb){const _0x37f4c0=a0_0x1089bc,_0x4b720b=/<([a-z][a-z0-9\-]*)\b[^>]*>(.*?)<\/\1>/g,_0x2ce5dd=/(?<!\:)\b(?:\w|-)+\=(['"])(.*?)\1/g,_0x56ff40=handleStringTpl(_0x405f19,_0xee52bb,!![]);_0x405f19=_0x56ff40[_0x37f4c0(0x124)];let _0x268efb=_0x56ff40['obj'];return!config[_0x37f4c0(0x11b)]&&(_0x405f19=_0x405f19[_0x37f4c0(0xee)](_0x4b720b,(_0x20e9f3,_0x2775c2,_0x7f9de4)=>{const _0x12e941=_0x37f4c0;if(hasChinese(_0x7f9de4)){if(/\{\{(.*?)\}\}/g['test'](_0x7f9de4)){const _0x3225e1=handleDoubleBrace(_0x7f9de4,_0xee52bb,_0x12e941(0x136),!![]);return _0x268efb=Object[_0x12e941(0x118)](_0x268efb,_0x3225e1[_0x12e941(0xf6)]),_0x20e9f3[_0x12e941(0xee)](_0x7f9de4,_0x3225e1['content']);}const _0x4bfaac=getTranslateKey(_0x7f9de4,_0xee52bb);return _0x268efb[_0x4bfaac]=_0x7f9de4,_0x20e9f3[_0x12e941(0xee)](_0x7f9de4,'{{\x20$t(\x27'+_0x4bfaac+'\x27)\x20}}');}return _0x20e9f3;}),_0x405f19=_0x405f19[_0x37f4c0(0xee)](_0x2ce5dd,(_0x1e7825,_0x130ff7,_0x1666d8)=>{const _0xce2bf7=_0x37f4c0;if(hasChinese(_0x1666d8)){const _0x2bf2de=getTranslateKey(_0x1666d8,_0xee52bb);return _0x268efb[_0x2bf2de]=_0x1666d8,':'+_0x1e7825[_0xce2bf7(0xee)](_0x1666d8,_0xce2bf7(0x113)+_0x2bf2de+'\x27)');}return _0x1e7825;})),{'content':_0x405f19,'obj':_0x268efb};}function handleScript(_0x2d1e40,_0x25ef49){const _0x331f3b=a0_0x1089bc,_0x1e4983=/(?<!\$t\(\s*)(['"])(.*?)(\1)/g,_0x5bba3a=handleStringTpl(_0x2d1e40,_0x25ef49);_0x2d1e40=_0x5bba3a[_0x331f3b(0x124)];let _0x73bb8a=_0x5bba3a['obj'];return!config['strict']&&(_0x2d1e40=_0x2d1e40[_0x331f3b(0xee)](_0x1e4983,(_0x14fe9f,_0x1f0205,_0x53e49b)=>{const _0x5e840e=_0x331f3b;if(hasChinese(_0x14fe9f)){const _0x1d5ce7=getTranslateKey(_0x14fe9f,_0x25ef49);return _0x73bb8a[_0x1d5ce7]=_0x53e49b,_0x5e840e(0x131)+_0x1d5ce7+'\x27)';}return _0x14fe9f;})),{'content':_0x2d1e40,'obj':_0x73bb8a};}function handleStringTpl(_0x396212,_0x170c1e,_0x2bc0a1){const _0x1056eb=a0_0x1089bc,_0x5bf174=/(?<!\$t\(\s*)`(.*?)`/g,_0x177818=/(?<=\$t\()`(.*?)`/g,_0x4bc590=/\${(.*?)}/g;let _0x4eb51e={};const _0x5d77d2=function(_0x69eff1,_0xbf9d04,_0x1dae7a){const _0x250d6b=a0_0x8de9,_0x1da49d=_0x69eff1[_0x250d6b(0xee)](_0x4bc590,'');if(hasChinese(_0x1da49d)){const _0x4f6457=getTranslateKey(_0x69eff1,_0x170c1e),_0x4cc2c1=_0x69eff1[_0x250d6b(0x10e)](_0x4bc590);if(_0x4cc2c1){const _0x3adda8=_0x4cc2c1['reduce']((_0x5ac1d0,_0x211740,_0x5bbce0)=>_0x5ac1d0[_0x250d6b(0xee)](_0x211740,'{'+_0x5bbce0+'}'),_0xbf9d04),_0x4cc6be=_0x4cc2c1[_0x250d6b(0xe3)](_0xe09dbe=>{const _0x417e76=_0x250d6b,_0x40dcf3=_0xe09dbe[_0x417e76(0xee)](_0x4bc590,'$1'),_0x332ace=handleDoubleBrace(_0x40dcf3,_0x170c1e,_0x2bc0a1?_0x417e76(0x136):_0x417e76(0x135));return _0x4eb51e=Object[_0x417e76(0x118)](_0x4eb51e,_0x332ace[_0x417e76(0xf6)]),_0x332ace[_0x417e76(0x124)];});return _0x4eb51e[_0x4f6457]=_0x3adda8,_0x1dae7a('\x27'+_0x4f6457+'\x27,\x20['+_0x4cc6be[_0x250d6b(0x11c)](',\x20')+']');}return _0x4eb51e[_0x4f6457]=_0xbf9d04,_0x1dae7a('\x27'+_0x4f6457+'\x27');}return _0x69eff1;};return _0x396212=_0x396212[_0x1056eb(0xee)](_0x177818,(_0x3bfa81,_0x15fef8)=>{return _0x5d77d2(_0x3bfa81,_0x15fef8,_0x17c10f=>_0x17c10f);}),!config[_0x1056eb(0x11b)]&&(_0x396212=_0x396212[_0x1056eb(0xee)](_0x5bf174,(_0x43a700,_0x587b67)=>{const _0x3c7d91=_0x1056eb;return _0x5d77d2(_0x43a700,_0x587b67,_0x332977=>_0x2bc0a1?'$t('+_0x332977+')':_0x3c7d91(0x114)+_0x332977+')');})),{'content':_0x396212,'obj':_0x4eb51e};}function handleDoubleBrace(_0x125fd0,_0x313544,_0x2889f3='$key',_0x2d58e5=![]){const _0x565835=a0_0x1089bc,_0x2ec732=/(['"])(.*?)(\1)/g;let _0x244aa7={};if(_0x2d58e5){const _0x257818=(_0x125fd0[_0x565835(0x11d)](/{{.*?}}/)||[])['filter'](_0x2a2a76=>hasChinese(_0x2a2a76));_0x257818[_0x565835(0xf4)](_0x24b5fe=>{const _0x4f5750=_0x565835,_0x8b6dc4=getTranslateKey(_0x24b5fe,_0x313544);_0x125fd0=_0x125fd0[_0x4f5750(0xee)](_0x24b5fe,_0x4f5750(0x116)+_0x8b6dc4+_0x4f5750(0x141)),_0x244aa7[_0x8b6dc4]=_0x24b5fe;});}const _0x2e7a3e=(_0x125fd0['match'](_0x2ec732)||[])['filter'](_0x25b13f=>hasChinese(_0x25b13f));return _0x2e7a3e[_0x565835(0xf4)](_0x1bf76d=>{const _0x526ef7=_0x565835,_0x4351c8=getTranslateKey(_0x1bf76d,_0x313544);_0x125fd0=_0x125fd0[_0x526ef7(0xee)](_0x1bf76d,_0x2889f3['replace'](_0x526ef7(0x111),'\x27'+_0x4351c8+'\x27')),_0x244aa7[_0x4351c8]=_0x1bf76d['replace'](/^['"]|['"]$/g,'');}),{'content':_0x125fd0,'obj':_0x244aa7};}function outputLangFile(_0xbfac24,_0x24518c){const _0x28546d=a0_0x1089bc;if(config[_0x28546d(0x11e)]==_0x28546d(0x117)){const _0x36eae7=_0xbfac24[_0x28546d(0xee)](/\.(\w+)$/,_0x28546d(0x11a));fs[_0x28546d(0x12d)](_0x36eae7,_0x24518c);}else config[_0x28546d(0x11e)]==_0x28546d(0x115)&&fs[_0x28546d(0x12d)](_0xbfac24,_0x24518c);}async function outputLocalFile(_0x3fd64f){const _0x14db9b=a0_0x1089bc,_0x389e5a=path[_0x14db9b(0x11c)](_path,config[_0x14db9b(0x100)]);if(/\.\w+$/g[_0x14db9b(0x117)](_0x389e5a)){const _0x4cd2a9=path['dirname'](_0x389e5a);!fs['existsSync'](_0x4cd2a9)&&fs[_0x14db9b(0x127)](_0x4cd2a9,{'recursive':!![]});const _0x9d12b=path[_0x14db9b(0xe2)](_0x389e5a);handleLocalFile(_0x3fd64f,_0x389e5a);for(let _0x2040c2=0x0;_0x2040c2<config[_0x14db9b(0x12c)][_0x14db9b(0x10f)];_0x2040c2++){const _0x1ac7be=config[_0x14db9b(0x12c)][_0x2040c2];if(_0x1ac7be=='zh'||_0x1ac7be[_0x14db9b(0x145)]()==_0x14db9b(0x144)){await handleLocalFile(_0x3fd64f,path[_0x14db9b(0x11c)](path[_0x14db9b(0xe0)](_0x389e5a),''+_0x1ac7be+_0x9d12b));return;}await handleLocalFile(_0x3fd64f,path[_0x14db9b(0x11c)](path[_0x14db9b(0xe0)](_0x389e5a),''+_0x1ac7be+_0x9d12b),_0x1ac7be,config[_0x14db9b(0xef)][_0x14db9b(0x119)](_0x1ac7be));}statisticalSort(_0x3fd64f);}else{!fs['existsSync'](_0x389e5a)&&fs[_0x14db9b(0x127)](_0x389e5a,{'recursive':!![]});handleLocalFile(_0x3fd64f,path[_0x14db9b(0x11c)](_0x389e5a,'local.json'));for(let _0x4237c7=0x0;_0x4237c7<config[_0x14db9b(0x12c)][_0x14db9b(0x10f)];_0x4237c7++){const _0x274ed7=config['locals'][_0x4237c7];if(_0x274ed7=='zh'||_0x274ed7['toLowerCase']()==_0x14db9b(0x144)){await handleLocalFile(_0x3fd64f,path[_0x14db9b(0x11c)](_0x389e5a,_0x274ed7+_0x14db9b(0x122)));return;}await handleLocalFile(_0x3fd64f,path[_0x14db9b(0x11c)](_0x389e5a,_0x274ed7+_0x14db9b(0x122)),_0x274ed7,config['translate']['includes'](_0x274ed7));}statisticalSort(_0x3fd64f);}}async function handleLocalFile(_0xfdce4d,_0x1f0a2c,_0x3ccf16,_0xa2cea7){const _0x34407e=function(_0x1a4ad5){const _0x1392a2=a0_0x8de9,_0x3c7b54=path['extname'](_0x1f0a2c);if(_0x3c7b54==_0x1392a2(0x10c)){let _0x4eabe2=Object[_0x1392a2(0xfd)](_0x1a4ad5)['map'](_0x3c52e4=>'\x20\x20'+_0x3c52e4+_0x1392a2(0x146)+_0x1a4ad5[_0x3c52e4]+'\x22')[_0x1392a2(0x11c)](',\x0d');fs[_0x1392a2(0x12d)](_0x1f0a2c,_0x1392a2(0xe6)+_0x4eabe2+'\x0d}');}else{let _0x30d33c=Object[_0x1392a2(0xfd)](_0x1a4ad5)[_0x1392a2(0xe3)](_0x49d048=>_0x1392a2(0xf0)+_0x49d048+_0x1392a2(0xf9)+_0x1a4ad5[_0x49d048]+'\x22')[_0x1392a2(0x11c)](',\x0d');fs[_0x1392a2(0x12d)](_0x1f0a2c,'{\x0d'+_0x30d33c+'\x0d}');}};let _0x33d32f,_0x2aee11;getFileContent(_0x1f0a2c,_0x567d07=>{_0x33d32f=Object['assign']({},_0xfdce4d,_0x567d07),_0x2aee11=getExtraValues(_0xfdce4d,_0x567d07);},()=>{const _0x3e5d80=a0_0x8de9;_0x33d32f=JSON[_0x3e5d80(0xfe)](JSON['stringify'](_0xfdce4d)),_0x2aee11=JSON[_0x3e5d80(0xfe)](JSON[_0x3e5d80(0x123)](_0xfdce4d));}),_0xa2cea7?await translater(_0x2aee11,_0x3ccf16,config,_0x37f25a=>{const _0x41dabb=a0_0x8de9;_0x33d32f=Object[_0x41dabb(0x118)](_0x33d32f,_0x37f25a),_0x34407e(_0x33d32f);}):_0x34407e(_0x33d32f);}function getExtraValues(_0x28dd06,_0x5866a0){const _0xb2dc02=a0_0x1089bc,_0x1a7fac=Object[_0xb2dc02(0xfd)](_0x28dd06)[_0xb2dc02(0x109)](_0xf5196b=>!_0x5866a0['hasOwnProperty'](_0xf5196b)),_0x564ace={};return _0x1a7fac[_0xb2dc02(0xf4)](_0xe3e60=>{_0x564ace[_0xe3e60]=_0x28dd06[_0xe3e60];}),_0x564ace;}function statisticalSort(_0x5dd468){const _0x318a02=a0_0x1089bc,_0x4f1f65=Object[_0x318a02(0xdb)](_0x5dd468);let _0x441db9={};for(let _0x15dc37=0x0;_0x15dc37<_0x4f1f65[_0x318a02(0x10f)];_0x15dc37++){const _0x53943c=_0x4f1f65[_0x15dc37];_0x441db9[_0x53943c]?_0x441db9[_0x53943c]++:_0x441db9[_0x53943c]=0x1;}const _0x103a7f=Object['entries'](_0x441db9)['sort']((_0xaf6ebe,_0x581e73)=>_0x581e73[0x1]-_0xaf6ebe[0x1]);console['log'](new Array(0x45)[_0x318a02(0x11c)]('-')),console[_0x318a02(0xe1)](_0x318a02(0x107));for(let _0x2ed91a=0x0;_0x2ed91a<_0x103a7f['length'];_0x2ed91a++){const _0x5a5493=_0x103a7f[_0x2ed91a];console[_0x318a02(0xe1)]('-----------\x20\x20第'+(_0x2ed91a+0x1)+'名('+_0x5a5493[0x1]+'):'+_0x5a5493[0x0]);if(_0x2ed91a===0xa)break;}console[_0x318a02(0xe1)]('-----------\x20中文字段统计频率排行榜'),console[_0x318a02(0xe1)](new Array(0x45)[_0x318a02(0x11c)]('-'));} |
@@ -1,1 +0,1 @@ | ||
const a1_0x31c307=a1_0x1c35;function a1_0x218a(){const _0x4778ff=['tag\x20<','slice','indexOf','shouldDecodeNewlinesForHref','end','match','<div><span\x20class=\x22title\x22>测试</span><my-component/></div>','ssss','3gUThPG','log','replace','6306237yuHUgS','toLowerCase','7ThERCA','【结束标签】:','闭合标签','script,style,textarea','7276428bemOQE','2716474sFOtAV','test','开始标签','350751sZFbxJ','substring','split','lowerCasedTag','attrs','6531784XxBfna','>\x20has\x20no\x20matching\x20end\x20tag.','push','unarySlash','create','href','length','【文本内容】:','start','8645440igIMCk','4782500RgfhcI','shouldDecodeNewlines','tagName'];a1_0x218a=function(){return _0x4778ff;};return a1_0x218a();}(function(_0x449b1e,_0x4043fd){const _0x1c60b7=a1_0x1c35,_0xd35996=_0x449b1e();while(!![]){try{const _0x183a9d=parseInt(_0x1c60b7(0xe5))/0x1+parseInt(_0x1c60b7(0xe2))/0x2+parseInt(_0x1c60b7(0xd8))/0x3*(parseInt(_0x1c60b7(0xcd))/0x4)+-parseInt(_0x1c60b7(0xf3))/0x5+parseInt(_0x1c60b7(0xe1))/0x6+parseInt(_0x1c60b7(0xdd))/0x7*(-parseInt(_0x1c60b7(0xea))/0x8)+-parseInt(_0x1c60b7(0xdb))/0x9;if(_0x183a9d===_0x4043fd)break;else _0xd35996['push'](_0xd35996['shift']());}catch(_0x88ddfc){_0xd35996['push'](_0xd35996['shift']());}}}(a1_0x218a,0xd4ab9));function a1_0x1c35(_0x197f40,_0x2b9ab9){const _0x218aaa=a1_0x218a();return a1_0x1c35=function(_0x1c357e,_0x9b7c65){_0x1c357e=_0x1c357e-0xcd;let _0x236151=_0x218aaa[_0x1c357e];return _0x236151;},a1_0x1c35(_0x197f40,_0x2b9ab9);}function makeMap(_0x4595b7,_0xbb889e){const _0x2ef3e5=a1_0x1c35,_0x29d5f0=Object[_0x2ef3e5(0xee)](null),_0x2be212=_0x4595b7[_0x2ef3e5(0xe7)](',');for(let _0x14459d=0x0;_0x14459d<_0x2be212[_0x2ef3e5(0xf0)];_0x14459d++){_0x29d5f0[_0x2be212[_0x14459d]]=!![];}return _0xbb889e?_0xbe7069=>_0x29d5f0[_0xbe7069['toLowerCase']()]:_0x4777a7=>_0x29d5f0[_0x4777a7];}const doctype=/^<!DOCTYPE [^>]+>/i,endTag=/^<\/([a-zA-Z_][\-\.0-9_a-zA-Z]*)[^>]*>/,startTagOpen=/^<([a-zA-Z_][\-\.0-9_a-zA-Z]*)/,attribute=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,dynamicArgAttribute=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,startTagClose=/^\s*(\/?)>/,isPlainTextElement=makeMap(a1_0x31c307(0xe0),!![]),isIgnoreNewlineTag=makeMap('pre,textarea',!![]),shouldIgnoreFirstNewline=(_0x5c90a0,_0x50d765)=>_0x5c90a0&&isIgnoreNewlineTag(_0x5c90a0)&&_0x50d765[0x0]==='\x0a',decodingMap={'<':'<','>':'>','"':'\x22','&':'&',' ':'\x0a','	':'\x09',''':'\x27'},encodedAttr=/&(?:lt|gt|quot|amp|#39);/g,encodedAttrWithNewLines=/&(?:lt|gt|quot|amp|#39|#10|#9);/g;function decodeAttr(_0x4293cb,_0x1d1f3b){const _0x1265af=a1_0x31c307,_0x39a9c3=_0x1d1f3b?encodedAttrWithNewLines:encodedAttr;return _0x4293cb[_0x1265af(0xda)](_0x39a9c3,_0x2e6590=>decodingMap[_0x2e6590]);}parseHTML(a1_0x31c307(0xd6));function parseHTML(_0x11cbae,_0x2e4690={'shouldDecodeNewlines':!![],'shouldDecodeNewlinesForHref':!![]}){const _0x8ef09d=a1_0x31c307,_0x327a0d=[];let _0x268289=0x0,_0x8faacd,_0x17299b;while(_0x11cbae){_0x8faacd=_0x11cbae,console[_0x8ef09d(0xd9)](_0x11cbae);if(!_0x17299b||!isPlainTextElement(_0x17299b)){let _0x2ff615=_0x11cbae[_0x8ef09d(0xd2)]('<');if(_0x2ff615===0x0){const _0x29fb9f=_0x11cbae['match'](doctype);if(_0x29fb9f){_0x450da3(_0x29fb9f[0x0]['length']);continue;}const _0x58cc05=_0x11cbae[_0x8ef09d(0xd5)](endTag);if(_0x58cc05){console[_0x8ef09d(0xd9)](_0x8ef09d(0xde)+_0x58cc05[0x1]);const _0x5b67e4=_0x268289;_0x450da3(_0x58cc05[0x0][_0x8ef09d(0xf0)]),_0x2fc138(_0x58cc05[0x1],_0x5b67e4,_0x268289);continue;}const _0x4de474=_0x30375e();if(_0x4de474){console[_0x8ef09d(0xd9)]('【'+(_0x4de474[_0x8ef09d(0xed)]?_0x8ef09d(0xdf):_0x8ef09d(0xe4))+'】:'+_0x4de474['tagName']);continue;}}let _0x237a35,_0x11f517,_0x3d04e2;if(_0x2ff615>=0x0){_0x11f517=_0x11cbae[_0x8ef09d(0xd1)](_0x2ff615);while(!endTag[_0x8ef09d(0xe3)](_0x11f517)&&!startTagOpen['test'](_0x11f517)){_0x3d04e2=_0x11f517[_0x8ef09d(0xd2)]('<',0x1);if(_0x3d04e2<0x0)break;_0x2ff615+=_0x3d04e2,_0x11f517=_0x11cbae[_0x8ef09d(0xd1)](_0x2ff615);}_0x237a35=_0x11cbae[_0x8ef09d(0xe6)](0x0,_0x2ff615),console[_0x8ef09d(0xd9)](_0x8ef09d(0xf1)+_0x237a35);}_0x2ff615<0x0&&(_0x237a35=_0x11cbae),_0x237a35&&_0x450da3(_0x237a35[_0x8ef09d(0xf0)]);}else{}if(_0x11cbae===_0x8faacd){}}function _0x450da3(_0x5e9464){_0x268289+=_0x5e9464,_0x11cbae=_0x11cbae['substring'](_0x5e9464);}function _0x30375e(){const _0x39aa6f=_0x8ef09d,_0x486e89=_0x11cbae[_0x39aa6f(0xd5)](startTagOpen);if(_0x486e89){const _0x3da52={'tagName':_0x486e89[0x1],'attrs':[],'start':_0x268289};_0x450da3(_0x486e89[0x0][_0x39aa6f(0xf0)]);let _0x1583b8,_0x2500fb;while(!(_0x1583b8=_0x11cbae[_0x39aa6f(0xd5)](startTagClose))&&(_0x2500fb=_0x11cbae['match'](dynamicArgAttribute)||_0x11cbae[_0x39aa6f(0xd5)](attribute))){_0x2500fb[_0x39aa6f(0xf2)]=_0x268289,_0x450da3(_0x2500fb[0x0][_0x39aa6f(0xf0)]),_0x2500fb['end']=_0x268289,_0x3da52[_0x39aa6f(0xe9)]['push'](_0x2500fb);}if(_0x1583b8)return _0x3da52[_0x39aa6f(0xed)]=_0x1583b8[0x1],_0x450da3(_0x1583b8[0x0][_0x39aa6f(0xf0)]),_0x3da52[_0x39aa6f(0xd4)]=_0x268289,_0x3da52;}}function _0x54faa7(_0x599e83){const _0x254616=_0x8ef09d,_0x1207ac=_0x599e83[_0x254616(0xcf)],_0x189cb9=!!_0x599e83[_0x254616(0xed)],_0x4044ed=_0x599e83[_0x254616(0xe9)]['length'],_0x38af5a=new Array(_0x4044ed);for(let _0x3680ec=0x0;_0x3680ec<_0x4044ed;_0x3680ec++){const _0x865c48=_0x599e83[_0x254616(0xe9)][_0x3680ec],_0x58356a=_0x865c48[0x3]||_0x865c48[0x4]||_0x865c48[0x5]||'',_0x39122a=_0x1207ac==='a'&&_0x865c48[0x1]===_0x254616(0xef)?_0x2e4690[_0x254616(0xd3)]:_0x2e4690[_0x254616(0xce)];_0x38af5a[_0x3680ec]={'name':_0x865c48[0x1],'value':decodeAttr(_0x58356a,_0x39122a)};}!_0x189cb9&&(_0x327a0d[_0x254616(0xec)]({'tag':_0x1207ac,'lowerCasedTag':_0x1207ac[_0x254616(0xdc)](),'attrs':_0x38af5a,'start':_0x599e83['start'],'end':_0x599e83[_0x254616(0xd4)]}),_0x17299b=_0x1207ac);}function _0x2fc138(_0x541288,_0x26fa6c,_0x42339a){const _0x9824f3=_0x8ef09d;let _0x460b38,_0xc0f9ad;if(_0x26fa6c==null)_0x26fa6c=_0x268289;if(_0x42339a==null)_0x42339a=_0x268289;if(_0x541288){_0xc0f9ad=_0x541288['toLowerCase']();for(_0x460b38=_0x327a0d[_0x9824f3(0xf0)]-0x1;_0x460b38>=0x0;_0x460b38--){if(_0x327a0d[_0x460b38][_0x9824f3(0xe8)]===_0xc0f9ad)break;}}else _0x460b38=0x0;console[_0x9824f3(0xd9)](_0x9824f3(0xd7)+_0x460b38);if(_0x460b38>=0x0){for(let _0x32b6c4=_0x327a0d[_0x9824f3(0xf0)]-0x1;_0x32b6c4>=_0x460b38;_0x32b6c4--){(_0x32b6c4>_0x460b38||!_0x541288)&&console['warn'](_0x9824f3(0xd0)+_0x327a0d[_0x32b6c4]['tag']+_0x9824f3(0xeb));}_0x327a0d[_0x9824f3(0xf0)]=_0x460b38,_0x17299b=_0x460b38&&_0x327a0d[_0x460b38-0x1]['tag'];}}} | ||
function a1_0x3475(){const _0x5d723b=['test','tag\x20<','toLowerCase','warn','<div><span\x20class=\x22title\x22>测试</span><my-component/></div>','slice','>\x20has\x20no\x20matching\x20end\x20tag.','end','unarySlash','【文本内容】:','href','【结束标签】:','match','215sKYAZr','19261940nHUyHe','indexOf','create','split','attrs','2423085UxyfMo','substring','ssss','length','55104FldjLz','4031MbZzth','start','8NdbkzM','shouldDecodeNewlines','lowerCasedTag','4776140wvHeCK','push','log','tag','闭合标签','4399094HxMpXw','tagName','578dYLFYZ','49869rZXcSH','shouldDecodeNewlinesForHref'];a1_0x3475=function(){return _0x5d723b;};return a1_0x3475();}const a1_0x2daad1=a1_0x3cc8;(function(_0x37d09e,_0x3b62b4){const _0x381c83=a1_0x3cc8,_0x2a6190=_0x37d09e();while(!![]){try{const _0x2d3fff=parseInt(_0x381c83(0x1d8))/0x1*(-parseInt(_0x381c83(0x1e4))/0x2)+parseInt(_0x381c83(0x1d3))/0x3+-parseInt(_0x381c83(0x1dd))/0x4+-parseInt(_0x381c83(0x1cd))/0x5*(parseInt(_0x381c83(0x1d7))/0x6)+parseInt(_0x381c83(0x1e2))/0x7+-parseInt(_0x381c83(0x1da))/0x8*(parseInt(_0x381c83(0x1e5))/0x9)+parseInt(_0x381c83(0x1ce))/0xa;if(_0x2d3fff===_0x3b62b4)break;else _0x2a6190['push'](_0x2a6190['shift']());}catch(_0x1e44d6){_0x2a6190['push'](_0x2a6190['shift']());}}}(a1_0x3475,0x93304));function makeMap(_0x1d2f3e,_0x6c444){const _0x2ddc7d=a1_0x3cc8,_0x395487=Object[_0x2ddc7d(0x1d0)](null),_0x54260a=_0x1d2f3e[_0x2ddc7d(0x1d1)](',');for(let _0x57a7ae=0x0;_0x57a7ae<_0x54260a['length'];_0x57a7ae++){_0x395487[_0x54260a[_0x57a7ae]]=!![];}return _0x6c444?_0x1695d5=>_0x395487[_0x1695d5[_0x2ddc7d(0x1e9)]()]:_0x2c59b3=>_0x395487[_0x2c59b3];}function a1_0x3cc8(_0x96f1ab,_0x271f0d){const _0x3475ff=a1_0x3475();return a1_0x3cc8=function(_0x3cc80a,_0x1f80b8){_0x3cc80a=_0x3cc80a-0x1c4;let _0x27cee8=_0x3475ff[_0x3cc80a];return _0x27cee8;},a1_0x3cc8(_0x96f1ab,_0x271f0d);}const doctype=/^<!DOCTYPE [^>]+>/i,endTag=/^<\/([a-zA-Z_][\-\.0-9_a-zA-Z]*)[^>]*>/,startTagOpen=/^<([a-zA-Z_][\-\.0-9_a-zA-Z]*)/,attribute=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,dynamicArgAttribute=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,startTagClose=/^\s*(\/?)>/,isPlainTextElement=makeMap('script,style,textarea',!![]),isIgnoreNewlineTag=makeMap('pre,textarea',!![]),shouldIgnoreFirstNewline=(_0x3d05ed,_0x4146c9)=>_0x3d05ed&&isIgnoreNewlineTag(_0x3d05ed)&&_0x4146c9[0x0]==='\x0a',decodingMap={'<':'<','>':'>','"':'\x22','&':'&',' ':'\x0a','	':'\x09',''':'\x27'},encodedAttr=/&(?:lt|gt|quot|amp|#39);/g,encodedAttrWithNewLines=/&(?:lt|gt|quot|amp|#39|#10|#9);/g;function decodeAttr(_0x555d27,_0x98fa3f){const _0x4c3d75=_0x98fa3f?encodedAttrWithNewLines:encodedAttr;return _0x555d27['replace'](_0x4c3d75,_0x162f1a=>decodingMap[_0x162f1a]);}parseHTML(a1_0x2daad1(0x1c4));function parseHTML(_0x55d628,_0x49decd={'shouldDecodeNewlines':!![],'shouldDecodeNewlinesForHref':!![]}){const _0xdb6f03=a1_0x2daad1,_0x161e87=[];let _0x1aed5b=0x0,_0x35095b,_0x4d6b5;while(_0x55d628){_0x35095b=_0x55d628,console['log'](_0x55d628);if(!_0x4d6b5||!isPlainTextElement(_0x4d6b5)){let _0x238004=_0x55d628['indexOf']('<');if(_0x238004===0x0){const _0x3857bf=_0x55d628[_0xdb6f03(0x1cc)](doctype);if(_0x3857bf){_0x22c755(_0x3857bf[0x0][_0xdb6f03(0x1d6)]);continue;}const _0x247f00=_0x55d628[_0xdb6f03(0x1cc)](endTag);if(_0x247f00){console['log'](_0xdb6f03(0x1cb)+_0x247f00[0x1]);const _0x22c741=_0x1aed5b;_0x22c755(_0x247f00[0x0]['length']),_0x2785ce(_0x247f00[0x1],_0x22c741,_0x1aed5b);continue;}const _0x14a75b=_0x1e3c78();if(_0x14a75b){console[_0xdb6f03(0x1df)]('【'+(_0x14a75b[_0xdb6f03(0x1c8)]?_0xdb6f03(0x1e1):'开始标签')+'】:'+_0x14a75b[_0xdb6f03(0x1e3)]);continue;}}let _0x565a10,_0x2ebe41,_0x4d48a1;if(_0x238004>=0x0){_0x2ebe41=_0x55d628[_0xdb6f03(0x1c5)](_0x238004);while(!endTag['test'](_0x2ebe41)&&!startTagOpen[_0xdb6f03(0x1e7)](_0x2ebe41)){_0x4d48a1=_0x2ebe41[_0xdb6f03(0x1cf)]('<',0x1);if(_0x4d48a1<0x0)break;_0x238004+=_0x4d48a1,_0x2ebe41=_0x55d628[_0xdb6f03(0x1c5)](_0x238004);}_0x565a10=_0x55d628[_0xdb6f03(0x1d4)](0x0,_0x238004),console[_0xdb6f03(0x1df)](_0xdb6f03(0x1c9)+_0x565a10);}_0x238004<0x0&&(_0x565a10=_0x55d628),_0x565a10&&_0x22c755(_0x565a10['length']);}else{}if(_0x55d628===_0x35095b){}}function _0x22c755(_0x120e98){const _0x206fae=_0xdb6f03;_0x1aed5b+=_0x120e98,_0x55d628=_0x55d628[_0x206fae(0x1d4)](_0x120e98);}function _0x1e3c78(){const _0x31c4fd=_0xdb6f03,_0x2f53be=_0x55d628[_0x31c4fd(0x1cc)](startTagOpen);if(_0x2f53be){const _0x49b934={'tagName':_0x2f53be[0x1],'attrs':[],'start':_0x1aed5b};_0x22c755(_0x2f53be[0x0]['length']);let _0x2a57f8,_0x5f21ea;while(!(_0x2a57f8=_0x55d628[_0x31c4fd(0x1cc)](startTagClose))&&(_0x5f21ea=_0x55d628['match'](dynamicArgAttribute)||_0x55d628[_0x31c4fd(0x1cc)](attribute))){_0x5f21ea['start']=_0x1aed5b,_0x22c755(_0x5f21ea[0x0][_0x31c4fd(0x1d6)]),_0x5f21ea['end']=_0x1aed5b,_0x49b934[_0x31c4fd(0x1d2)][_0x31c4fd(0x1de)](_0x5f21ea);}if(_0x2a57f8)return _0x49b934[_0x31c4fd(0x1c8)]=_0x2a57f8[0x1],_0x22c755(_0x2a57f8[0x0][_0x31c4fd(0x1d6)]),_0x49b934[_0x31c4fd(0x1c7)]=_0x1aed5b,_0x49b934;}}function _0x31eaac(_0x4d2508){const _0x24f7a9=_0xdb6f03,_0x4b8b5a=_0x4d2508[_0x24f7a9(0x1e3)],_0x3208c3=!!_0x4d2508[_0x24f7a9(0x1c8)],_0x8714f7=_0x4d2508[_0x24f7a9(0x1d2)][_0x24f7a9(0x1d6)],_0x10994f=new Array(_0x8714f7);for(let _0x1ad6a3=0x0;_0x1ad6a3<_0x8714f7;_0x1ad6a3++){const _0x20d9ef=_0x4d2508[_0x24f7a9(0x1d2)][_0x1ad6a3],_0x149603=_0x20d9ef[0x3]||_0x20d9ef[0x4]||_0x20d9ef[0x5]||'',_0x98243f=_0x4b8b5a==='a'&&_0x20d9ef[0x1]===_0x24f7a9(0x1ca)?_0x49decd[_0x24f7a9(0x1e6)]:_0x49decd[_0x24f7a9(0x1db)];_0x10994f[_0x1ad6a3]={'name':_0x20d9ef[0x1],'value':decodeAttr(_0x149603,_0x98243f)};}!_0x3208c3&&(_0x161e87[_0x24f7a9(0x1de)]({'tag':_0x4b8b5a,'lowerCasedTag':_0x4b8b5a[_0x24f7a9(0x1e9)](),'attrs':_0x10994f,'start':_0x4d2508[_0x24f7a9(0x1d9)],'end':_0x4d2508[_0x24f7a9(0x1c7)]}),_0x4d6b5=_0x4b8b5a);}function _0x2785ce(_0x579870,_0x150ce3,_0x4d2230){const _0x579600=_0xdb6f03;let _0xc882be,_0x2dd88b;if(_0x150ce3==null)_0x150ce3=_0x1aed5b;if(_0x4d2230==null)_0x4d2230=_0x1aed5b;if(_0x579870){_0x2dd88b=_0x579870[_0x579600(0x1e9)]();for(_0xc882be=_0x161e87[_0x579600(0x1d6)]-0x1;_0xc882be>=0x0;_0xc882be--){if(_0x161e87[_0xc882be][_0x579600(0x1dc)]===_0x2dd88b)break;}}else _0xc882be=0x0;console[_0x579600(0x1df)](_0x579600(0x1d5)+_0xc882be);if(_0xc882be>=0x0){for(let _0x42569a=_0x161e87[_0x579600(0x1d6)]-0x1;_0x42569a>=_0xc882be;_0x42569a--){(_0x42569a>_0xc882be||!_0x579870)&&console[_0x579600(0x1ea)](_0x579600(0x1e8)+_0x161e87[_0x42569a][_0x579600(0x1e0)]+_0x579600(0x1c6));}_0x161e87['length']=_0xc882be,_0x4d6b5=_0xc882be&&_0x161e87[_0xc882be-0x1]['tag'];}}} |
@@ -1,1 +0,1 @@ | ||
const a2_0x4f1e5f=a2_0x372d;(function(_0x15d681,_0x9230a0){const _0xdc3972=a2_0x372d,_0x7f3700=_0x15d681();while(!![]){try{const _0x309529=-parseInt(_0xdc3972(0x19f))/0x1+-parseInt(_0xdc3972(0x1bf))/0x2*(parseInt(_0xdc3972(0x1b9))/0x3)+-parseInt(_0xdc3972(0x1a6))/0x4+-parseInt(_0xdc3972(0x1a3))/0x5+parseInt(_0xdc3972(0x1d0))/0x6+-parseInt(_0xdc3972(0x1be))/0x7*(parseInt(_0xdc3972(0x1cd))/0x8)+parseInt(_0xdc3972(0x1b1))/0x9;if(_0x309529===_0x9230a0)break;else _0x7f3700['push'](_0x7f3700['shift']());}catch(_0x4a657b){_0x7f3700['push'](_0x7f3700['shift']());}}}(a2_0x4c0f,0xa3bf5));function a2_0x372d(_0x141e78,_0x5db6ba){const _0x4c0f9a=a2_0x4c0f();return a2_0x372d=function(_0x372d0b,_0x44e758){_0x372d0b=_0x372d0b-0x19f;let _0x30e890=_0x4c0f9a[_0x372d0b];return _0x30e890;},a2_0x372d(_0x141e78,_0x5db6ba);}const axios=require(a2_0x4f1e5f(0x1b0)),CryptoJS=require(a2_0x4f1e5f(0x1d3));function md5Hash32(_0x48765d){const _0x11fa34=a2_0x4f1e5f;return CryptoJS[_0x11fa34(0x1c3)](_0x48765d)[_0x11fa34(0x1cc)](CryptoJS['enc'][_0x11fa34(0x1aa)])[_0x11fa34(0x1a2)]();}function sha256Hash32(_0x2acbbe){const _0x257ecb=a2_0x4f1e5f;return CryptoJS[_0x257ecb(0x1ac)](_0x2acbbe)[_0x257ecb(0x1cc)](CryptoJS[_0x257ecb(0x1bd)][_0x257ecb(0x1aa)])[_0x257ecb(0x1a2)]();}function a2_0x4c0f(){const _0x46b339=['\x20-\x20有道翻译请求完成','\x20-\x20有道翻译请求发起','trans_result','9SBsRsO','data','youdao','%\x20\x20','enc','21rkpWgf','498170mjyAsw','join','substring','\x20-\x20百度翻译请求完成','MD5','zh-tw','assign','zh-CHT','进度:','toFixed','baidu','success\x20','length','toString','1272664wxrhql','appKey','round','1014264wVBNZG','object','catch','crypto-js','replace','then','82217CGcANa','log','\x20-\x20百度翻译请求发起','toLowerCase','1156655jmqQsc','getTime','keys','5207412fEvVlZ','https://fanyi-api.baidu.com/api/trans/vip/translate','进度:异常终止,终止于:','get','Hex','fail:','SHA256','fra','errorCode','kor','axios','30074130AtePgt','secretKey','channel','进度:0.00%\x20\x20success','translation'];a2_0x4c0f=function(){return _0x46b339;};return a2_0x4c0f();}function promisify(_0xa78a80,..._0x3c57b0){return new Promise((_0x245dae,_0x59ba08)=>{_0xa78a80(..._0x3c57b0,(_0x2b091b,_0x2d91e3)=>{_0x245dae({'value':_0x2b091b,'error':_0x2d91e3});});});}function delay(_0x17757c){return new Promise(_0x15830c=>setTimeout(_0x15830c,_0x17757c));}function logInfo(_0x50723a){const _0x429332=a2_0x4f1e5f,_0x1774de=0x28-_0x50723a[_0x429332(0x1d4)](/[\u4e00-\u9fa5]/g,'a')['length'],_0x432599=new Array(0x14)[_0x429332(0x1c0)]('-'),_0x5f3886=new Array(_0x1774de>0x0?_0x1774de:0x14)[_0x429332(0x1c0)]('-');return _0x432599+'\x20'+_0x50723a+'\x20'+_0x5f3886;}async function baiduTranslateObj(_0x5854aa,_0x499868,_0xb3e24a,_0x26e533){const _0x34c6c5=a2_0x4f1e5f;var _0x44d38b=Object[_0x34c6c5(0x1a5)](_0x5854aa),_0x2c6e87={};console[_0x34c6c5(0x1a0)](logInfo(_0x499868+_0x34c6c5(0x1a1))),console[_0x34c6c5(0x1a0)](logInfo(_0x34c6c5(0x1b4)));for(var _0x158470=0x0;_0x158470<_0x44d38b[_0x34c6c5(0x1cb)];_0x158470++){const _0x5e28b2=_0x44d38b[_0x158470],{value:_0xea45aa,error:_0x564699}=await promisify(baiduTranslate,_0x5854aa[_0x5e28b2],_0x499868,_0xb3e24a),_0x3da82f=((_0x158470+0x1)/_0x44d38b[_0x34c6c5(0x1cb)]*0x64)[_0x34c6c5(0x1c8)](0x2);console['log'](logInfo(_0x34c6c5(0x1c7)+_0x3da82f+'%\x20\x20'+(_0xea45aa?_0x34c6c5(0x1ca):_0x34c6c5(0x1ab))+(_0x564699||''))),await delay(0x3e8),_0x2c6e87[_0x5e28b2]=_0xea45aa||_0x5854aa[_0x5e28b2];if(!_0xea45aa){_0x2c6e87=Object[_0x34c6c5(0x1c5)](_0x5854aa,_0x2c6e87),console[_0x34c6c5(0x1a0)](logInfo('进度:异常终止,终止于:'+_0x5e28b2));break;}}console['log'](logInfo(_0x499868+_0x34c6c5(0x1c2))),_0x26e533&&_0x26e533(_0x2c6e87);}function baiduTranslate(_0x64b678,_0x3a393f,_0x599334,_0x44f0f5){const _0x261a60=a2_0x4f1e5f;_0x3a393f=_0x3a393f[_0x261a60(0x1a2)]();if(_0x3a393f=='zh')return _0x64b678;if(_0x3a393f==_0x261a60(0x1c4))_0x3a393f='cht';if(_0x3a393f=='fr')_0x3a393f=_0x261a60(0x1ad);if(_0x3a393f=='ko')_0x3a393f=_0x261a60(0x1af);if(_0x3a393f=='ja')_0x3a393f='jp';const _0x4a1a30=new Date()[_0x261a60(0x1a4)](),_0x477980=md5Hash32(_0x599334[_0x261a60(0x1ce)]+_0x64b678+_0x4a1a30+_0x599334['secretKey']),_0x586aa3={'q':_0x64b678,'appid':_0x599334['appKey'],'salt':_0x4a1a30,'from':'zh','to':_0x3a393f,'sign':_0x477980};axios['get'](_0x261a60(0x1a7),{'params':_0x586aa3})[_0x261a60(0x1d5)](_0xf33201=>{const _0x5d0154=_0x261a60;if(_0xf33201['data']['trans_result']&&_0xf33201[_0x5d0154(0x1ba)][_0x5d0154(0x1b8)][0x0]){const _0x271a52=_0xf33201[_0x5d0154(0x1ba)][_0x5d0154(0x1b8)][0x0];_0x44f0f5&&_0x44f0f5(_0x271a52['dst']);return;}_0x44f0f5&&_0x44f0f5('',_0xf33201[_0x5d0154(0x1ba)]['error_code']);})[_0x261a60(0x1d2)](function(_0xe32d70){_0x44f0f5&&_0x44f0f5('',_0xe32d70);});}async function youDaoTranslateObj(_0x285f66,_0x4680a8,_0x71f28c,_0x44cd20){const _0x14fcaa=a2_0x4f1e5f;var _0xce364c=Object[_0x14fcaa(0x1a5)](_0x285f66),_0x54a59c={};console[_0x14fcaa(0x1a0)](logInfo(_0x4680a8+_0x14fcaa(0x1b7))),console[_0x14fcaa(0x1a0)](logInfo(_0x14fcaa(0x1b4)));for(var _0x3fc2c3=0x0;_0x3fc2c3<_0xce364c[_0x14fcaa(0x1cb)];_0x3fc2c3++){const _0x2302ee=_0xce364c[_0x3fc2c3],{value:_0x25ef95,error:_0x44cab8}=await promisify(youDaoTranslate,_0x285f66[_0x2302ee],_0x4680a8,_0x71f28c),_0x34263c=Number['parseInt']((_0x3fc2c3+0x1)/_0xce364c['length']*0x64);console[_0x14fcaa(0x1a0)](logInfo(_0x14fcaa(0x1c7)+_0x34263c+_0x14fcaa(0x1bc)+(_0x25ef95?'success\x20':_0x14fcaa(0x1ab))+(_0x44cab8||''))),await delay(0x3e8),_0x54a59c[_0x2302ee]=_0x25ef95||_0x285f66[_0x2302ee];if(!_0x25ef95){_0x54a59c=Object[_0x14fcaa(0x1c5)](_0x285f66,_0x54a59c),console[_0x14fcaa(0x1a0)](logInfo(_0x14fcaa(0x1a8)+_0x2302ee));break;}}console[_0x14fcaa(0x1a0)](logInfo(_0x4680a8+_0x14fcaa(0x1b6))),_0x44cd20&&_0x44cd20(_0x54a59c);}function youDaoTranslate(_0x535028,_0x58c2db,_0x456fb0,_0xd1e4eb){const _0x50fe11=a2_0x4f1e5f;_0x58c2db=_0x58c2db['toLowerCase']();if(_0x58c2db=='zh')return _0x535028;if(_0x58c2db==_0x50fe11(0x1c4))_0x58c2db=_0x50fe11(0x1c6);var _0x2588c9=new Date()['getTime'](),_0x3ad8bb=Math[_0x50fe11(0x1cf)](new Date()[_0x50fe11(0x1a4)]()/0x3e8);function _0x58300a(_0x5bc4b9){const _0x3183ad=_0x50fe11;var _0x5b85ba=_0x5bc4b9['length'];if(_0x5b85ba<=0x14)return _0x5bc4b9;return _0x5bc4b9[_0x3183ad(0x1c1)](0x0,0xa)+_0x5b85ba+_0x5bc4b9[_0x3183ad(0x1c1)](_0x5b85ba-0xa,_0x5b85ba);}var _0x1776ac=sha256Hash32(_0x456fb0[_0x50fe11(0x1ce)]+_0x58300a(_0x535028)+_0x2588c9+_0x3ad8bb+_0x456fb0[_0x50fe11(0x1b2)]),_0x4a1b8a={'q':_0x535028,'appKey':_0x456fb0[_0x50fe11(0x1ce)],'salt':_0x2588c9,'from':'zh','to':_0x58c2db,'sign':_0x1776ac,'signType':'v3','curtime':_0x3ad8bb};axios[_0x50fe11(0x1a9)]('https://openapi.youdao.com/api',{'params':_0x4a1b8a})['then'](_0x1fad2c=>{const _0x276c14=_0x50fe11;if(_0x1fad2c[_0x276c14(0x1ba)][_0x276c14(0x1ae)]=='0'&&_0x1fad2c[_0x276c14(0x1ba)][_0x276c14(0x1b5)]){const _0x385351=_0x1fad2c[_0x276c14(0x1ba)]['translation'][0x0]||'';_0xd1e4eb&&_0xd1e4eb(_0x385351);return;}_0xd1e4eb&&_0xd1e4eb('',_0x1fad2c[_0x276c14(0x1ba)][_0x276c14(0x1ae)]);})['catch'](function(_0x3d8402){_0xd1e4eb&&_0xd1e4eb('',_0x3d8402);});}exports['translater']=async function(_0x260e53,_0x25977f,_0x389594,_0xebdb21){const _0x3038d5=a2_0x4f1e5f;if(!_0x389594['channel']||!_0x389594[_0x3038d5(0x1ce)]||!_0x389594[_0x3038d5(0x1b2)]){_0xebdb21&&_0xebdb21(_0x260e53);return;}if(typeof _0x260e53!=_0x3038d5(0x1d1)||_0x260e53==null||!_0x260e53){_0xebdb21&&_0xebdb21(_0x260e53);return;}if(Object[_0x3038d5(0x1a5)](_0x260e53)[_0x3038d5(0x1cb)]==0x0){_0xebdb21&&_0xebdb21(_0x260e53);return;}if(_0x389594[_0x3038d5(0x1b3)]==_0x3038d5(0x1bb))await youDaoTranslateObj(_0x260e53,_0x25977f,_0x389594,_0xebdb21);else _0x389594[_0x3038d5(0x1b3)]==_0x3038d5(0x1c9)?await baiduTranslateObj(_0x260e53,_0x25977f,_0x389594,_0xebdb21):_0xebdb21&&_0xebdb21(_0x260e53);}; | ||
const a2_0x4b3159=a2_0x4b86;(function(_0x197414,_0x5a7f98){const _0x3196e9=a2_0x4b86,_0x463345=_0x197414();while(!![]){try{const _0x2073f7=parseInt(_0x3196e9(0x70))/0x1*(-parseInt(_0x3196e9(0x82))/0x2)+-parseInt(_0x3196e9(0x6e))/0x3+-parseInt(_0x3196e9(0x77))/0x4*(-parseInt(_0x3196e9(0x7b))/0x5)+parseInt(_0x3196e9(0x8b))/0x6+parseInt(_0x3196e9(0x94))/0x7*(parseInt(_0x3196e9(0x6f))/0x8)+-parseInt(_0x3196e9(0x8e))/0x9+parseInt(_0x3196e9(0xa1))/0xa;if(_0x2073f7===_0x5a7f98)break;else _0x463345['push'](_0x463345['shift']());}catch(_0x1b5889){_0x463345['push'](_0x463345['shift']());}}}(a2_0x4ebd,0xcccfb));const axios=require(a2_0x4b3159(0x81)),CryptoJS=require(a2_0x4b3159(0x90));function md5Hash32(_0x52cfdd){const _0x2715d2=a2_0x4b3159;return CryptoJS[_0x2715d2(0x6d)](_0x52cfdd)['toString'](CryptoJS[_0x2715d2(0x76)][_0x2715d2(0x7d)])[_0x2715d2(0x87)]();}function sha256Hash32(_0x512cd0){const _0x7202c=a2_0x4b3159;return CryptoJS['SHA256'](_0x512cd0)[_0x7202c(0x9d)](CryptoJS[_0x7202c(0x76)][_0x7202c(0x7d)])[_0x7202c(0x87)]();}function a2_0x4b86(_0x2cd6ac,_0x4c13d6){const _0x4ebdc6=a2_0x4ebd();return a2_0x4b86=function(_0x4b8641,_0x2763ef){_0x4b8641=_0x4b8641-0x6d;let _0x4a7385=_0x4ebdc6[_0x4b8641];return _0x4a7385;},a2_0x4b86(_0x2cd6ac,_0x4c13d6);}function promisify(_0x2132b9,..._0x3d3337){return new Promise((_0x5a99d5,_0x56db5f)=>{_0x2132b9(..._0x3d3337,(_0xf8eef,_0x88698f)=>{_0x5a99d5({'value':_0xf8eef,'error':_0x88698f});});});}function delay(_0x115186){return new Promise(_0x580969=>setTimeout(_0x580969,_0x115186));}function a2_0x4ebd(){const _0x2d1ae4=['log','crypto-js','assign','toFixed','object','766031QEmcmj','catch','errorCode','zh-CHT','baidu','then','进度:','success\x20','fra','toString','join','substring','parseInt','1302170qNyriI','zh-tw','MD5','2236929UCpuCb','72AkSudi','658KLcdTN','getTime','kor','trans_result','\x20-\x20百度翻译请求完成','%\x20\x20','enc','11484fbtjxA','dst','fail:','channel','2740sbdxKd','keys','Hex','length','cht','\x20-\x20有道翻译请求完成','axios','4652DxVJwp','data','translation','进度:异常终止,终止于:','appKey','toLowerCase','replace','get','https://openapi.youdao.com/api','4150752uvspFZ','进度:0.00%\x20\x20success','secretKey','2386404mNNFEc'];a2_0x4ebd=function(){return _0x2d1ae4;};return a2_0x4ebd();}function logInfo(_0x54dbf1){const _0x5dfe59=a2_0x4b3159,_0x3a8126=0x28-_0x54dbf1[_0x5dfe59(0x88)](/[\u4e00-\u9fa5]/g,'aa')[_0x5dfe59(0x7e)],_0x929daa=new Array(0x14)[_0x5dfe59(0x9e)]('-'),_0x361571=new Array(_0x3a8126>0x0?_0x3a8126:0x14)[_0x5dfe59(0x9e)]('-');return _0x929daa+'\x20'+_0x54dbf1+'\x20'+_0x361571;}async function baiduTranslateObj(_0x175434,_0x4052d1,_0x33268b,_0x5c8d9f){const _0x5ecc6d=a2_0x4b3159;var _0x5985e1=Object[_0x5ecc6d(0x7c)](_0x175434),_0x3967ae={};console[_0x5ecc6d(0x8f)](new Array(0x45)[_0x5ecc6d(0x9e)]('-')),console[_0x5ecc6d(0x8f)](logInfo(_0x4052d1+'\x20-\x20百度翻译请求发起')),console['log'](logInfo(_0x5ecc6d(0x8c)));for(var _0x22afa3=0x0;_0x22afa3<_0x5985e1[_0x5ecc6d(0x7e)];_0x22afa3++){const _0x15fd36=_0x5985e1[_0x22afa3],{value:_0x49613d,error:_0x1f2eb6}=await promisify(baiduTranslate,_0x175434[_0x15fd36],_0x4052d1,_0x33268b),_0x22427f=((_0x22afa3+0x1)/_0x5985e1[_0x5ecc6d(0x7e)]*0x64)[_0x5ecc6d(0x92)](0x2);console[_0x5ecc6d(0x8f)](logInfo(_0x5ecc6d(0x9a)+_0x22427f+_0x5ecc6d(0x75)+(_0x49613d?_0x5ecc6d(0x9b):_0x5ecc6d(0x79))+(_0x1f2eb6||''))),await delay(0x3e8),_0x3967ae[_0x15fd36]=_0x49613d||_0x175434[_0x15fd36];if(!_0x49613d){_0x3967ae=Object[_0x5ecc6d(0x91)](_0x175434,_0x3967ae),console[_0x5ecc6d(0x8f)](logInfo(_0x5ecc6d(0x85)+_0x15fd36));break;}}console[_0x5ecc6d(0x8f)](logInfo(_0x4052d1+_0x5ecc6d(0x74))),console[_0x5ecc6d(0x8f)](new Array(0x45)[_0x5ecc6d(0x9e)]('-')),_0x5c8d9f&&_0x5c8d9f(_0x3967ae);}function baiduTranslate(_0x9172e3,_0x106f24,_0x3835f6,_0x2c8358){const _0x1a5a5e=a2_0x4b3159;_0x106f24=_0x106f24['toLowerCase']();if(_0x106f24=='zh')return _0x9172e3;if(_0x106f24==_0x1a5a5e(0xa2))_0x106f24=_0x1a5a5e(0x7f);if(_0x106f24=='fr')_0x106f24=_0x1a5a5e(0x9c);if(_0x106f24=='ko')_0x106f24=_0x1a5a5e(0x72);if(_0x106f24=='ja')_0x106f24='jp';const _0x20e675=new Date()[_0x1a5a5e(0x71)](),_0x2269ae=md5Hash32(_0x3835f6['appKey']+_0x9172e3+_0x20e675+_0x3835f6['secretKey']),_0x247813={'q':_0x9172e3,'appid':_0x3835f6[_0x1a5a5e(0x86)],'salt':_0x20e675,'from':'zh','to':_0x106f24,'sign':_0x2269ae};axios[_0x1a5a5e(0x89)]('https://fanyi-api.baidu.com/api/trans/vip/translate',{'params':_0x247813})[_0x1a5a5e(0x99)](_0x357579=>{const _0x51992a=_0x1a5a5e;if(_0x357579[_0x51992a(0x83)][_0x51992a(0x73)]&&_0x357579[_0x51992a(0x83)][_0x51992a(0x73)][0x0]){const _0x1cf998=_0x357579[_0x51992a(0x83)][_0x51992a(0x73)][0x0];_0x2c8358&&_0x2c8358(_0x1cf998[_0x51992a(0x78)]);return;}_0x2c8358&&_0x2c8358('',_0x357579[_0x51992a(0x83)]['error_code']);})[_0x1a5a5e(0x95)](function(_0x276286){_0x2c8358&&_0x2c8358('',_0x276286);});}async function youDaoTranslateObj(_0x354647,_0x46fb75,_0x39b6d0,_0x14e6cf){const _0x1bdc11=a2_0x4b3159;var _0xe223fd=Object[_0x1bdc11(0x7c)](_0x354647),_0x528b7b={};console['log'](new Array(0x45)[_0x1bdc11(0x9e)]('-')),console['log'](logInfo(_0x46fb75+'\x20-\x20有道翻译请求发起')),console[_0x1bdc11(0x8f)](logInfo(_0x1bdc11(0x8c)));for(var _0x334f07=0x0;_0x334f07<_0xe223fd['length'];_0x334f07++){const _0x3428b2=_0xe223fd[_0x334f07],{value:_0x5cb896,error:_0x151797}=await promisify(youDaoTranslate,_0x354647[_0x3428b2],_0x46fb75,_0x39b6d0),_0x202251=Number[_0x1bdc11(0xa0)]((_0x334f07+0x1)/_0xe223fd['length']*0x64);console['log'](logInfo(_0x1bdc11(0x9a)+_0x202251+_0x1bdc11(0x75)+(_0x5cb896?_0x1bdc11(0x9b):_0x1bdc11(0x79))+(_0x151797||''))),await delay(0x3e8),_0x528b7b[_0x3428b2]=_0x5cb896||_0x354647[_0x3428b2];if(!_0x5cb896){_0x528b7b=Object[_0x1bdc11(0x91)](_0x354647,_0x528b7b),console[_0x1bdc11(0x8f)](logInfo(_0x1bdc11(0x85)+_0x3428b2));break;}}console['log'](logInfo(_0x46fb75+_0x1bdc11(0x80))),console[_0x1bdc11(0x8f)](new Array(0x45)[_0x1bdc11(0x9e)]('-')),_0x14e6cf&&_0x14e6cf(_0x528b7b);}function youDaoTranslate(_0x5543b6,_0x2d8f49,_0x1e8a04,_0xf36dc4){const _0xd05461=a2_0x4b3159;_0x2d8f49=_0x2d8f49[_0xd05461(0x87)]();if(_0x2d8f49=='zh')return _0x5543b6;if(_0x2d8f49==_0xd05461(0xa2))_0x2d8f49=_0xd05461(0x97);var _0x370bb5=new Date()['getTime'](),_0x225e55=Math['round'](new Date()[_0xd05461(0x71)]()/0x3e8);function _0x406019(_0x49b22b){const _0x443ef7=_0xd05461;var _0x2713e6=_0x49b22b[_0x443ef7(0x7e)];if(_0x2713e6<=0x14)return _0x49b22b;return _0x49b22b['substring'](0x0,0xa)+_0x2713e6+_0x49b22b[_0x443ef7(0x9f)](_0x2713e6-0xa,_0x2713e6);}var _0x3edf58=sha256Hash32(_0x1e8a04['appKey']+_0x406019(_0x5543b6)+_0x370bb5+_0x225e55+_0x1e8a04[_0xd05461(0x8d)]),_0x45ae36={'q':_0x5543b6,'appKey':_0x1e8a04[_0xd05461(0x86)],'salt':_0x370bb5,'from':'zh','to':_0x2d8f49,'sign':_0x3edf58,'signType':'v3','curtime':_0x225e55};axios[_0xd05461(0x89)](_0xd05461(0x8a),{'params':_0x45ae36})[_0xd05461(0x99)](_0x470361=>{const _0x4b7740=_0xd05461;if(_0x470361[_0x4b7740(0x83)][_0x4b7740(0x96)]=='0'&&_0x470361[_0x4b7740(0x83)][_0x4b7740(0x84)]){const _0x1e9455=_0x470361[_0x4b7740(0x83)][_0x4b7740(0x84)][0x0]||'';_0xf36dc4&&_0xf36dc4(_0x1e9455);return;}_0xf36dc4&&_0xf36dc4('',_0x470361[_0x4b7740(0x83)][_0x4b7740(0x96)]);})[_0xd05461(0x95)](function(_0x2b8c34){_0xf36dc4&&_0xf36dc4('',_0x2b8c34);});}exports['translater']=async function(_0x5348c1,_0x561d7,_0x524898,_0x419cb2){const _0x2ac051=a2_0x4b3159;if(!_0x524898[_0x2ac051(0x7a)]||!_0x524898[_0x2ac051(0x86)]||!_0x524898[_0x2ac051(0x8d)]){_0x419cb2&&_0x419cb2(_0x5348c1);return;}if(typeof _0x5348c1!=_0x2ac051(0x93)||_0x5348c1==null||!_0x5348c1){_0x419cb2&&_0x419cb2(_0x5348c1);return;}if(Object[_0x2ac051(0x7c)](_0x5348c1)[_0x2ac051(0x7e)]==0x0){_0x419cb2&&_0x419cb2(_0x5348c1);return;}if(_0x524898[_0x2ac051(0x7a)]=='youdao')await youDaoTranslateObj(_0x5348c1,_0x561d7,_0x524898,_0x419cb2);else _0x524898[_0x2ac051(0x7a)]==_0x2ac051(0x98)?await baiduTranslateObj(_0x5348c1,_0x561d7,_0x524898,_0x419cb2):_0x419cb2&&_0x419cb2(_0x5348c1);}; |
{ | ||
"name": "translate-compiler", | ||
"version": "0.8.0-beta", | ||
"version": "0.8.2-beta", | ||
"description": "Vue 国际化i18n编译器,自动提取项目(.vue)文件中的”中文“并替换为多语言($t(key)),并导出全部翻译到指定文件。", | ||
@@ -10,3 +10,3 @@ "main": "main/index.js", | ||
"scripts": { | ||
"dev": "node lib/index.js dev --dir example -o example/locals/local.json -l en ja --strict", | ||
"dev": "node lib/index.js dev --dir example -o example/locals/local.json -l en", | ||
"test": "node lib/index.js test --dir example -o example/locals -l zh en", | ||
@@ -13,0 +13,0 @@ "obf": "javascript-obfuscator lib --output main" |
@@ -19,3 +19,3 @@ # translate-compiler | ||
Arguments: | ||
env 指定环境:dev/test/prod | ||
env 指定环境:dev/test/prod | ||
@@ -32,3 +32,3 @@ Options: | ||
-o, --output <file> 翻译输出文件写入的文件(夹)路径,默认:locals/local.json | ||
--strict 是否严格模式, 严格模式只提取$t()内中文,否则全局 | ||
--strict 是否严格模式, 严格模式只提取$t()内中文,否则提取全局 | ||
@@ -41,30 +41,31 @@ ``` | ||
- test 为每个翻译文件生成后缀前加`.lang`的新文件,以便查看翻译后对照,并导出翻译文件。 | ||
- prod 翻译直接替换原文件,用于生产打包部署前命令,并导出翻译文件。 | ||
- prod 翻译 key 直接替换原文件,用于生产打包部署前命令,并导出翻译文件。 | ||
- 自动翻译: | ||
- 只有设置了`channel`、`appKey`、`secretKey`、`translate`(且`locals`参数含有该 key),才会执行翻译,默认填充中文。 | ||
- 已经原语言文件存在的 key 不会再做翻译,如需翻译可以删改该 key 或直接删除语言文件重新生成。 | ||
- 设置了`channel`、`appKey`、`secretKey`、`translate`(`locals`参数含有该语言 key),才会执行翻译,默认填充中文。 | ||
- 原翻译文件存在的 key 不会再做翻译,如需翻译可以删改该 key 或直接删除翻译文件重新生成。 | ||
- 其他备注: | ||
1. `test`生成的文件后缀前加`.lang`的新文件,可执行 `dev`/`prod` 删除。 | ||
2. `output`支持输出到文件或文件夹,文件支持`js`和`json`格式,指定文件夹则默认文件名为`local.json` | ||
3. 指定`locals`参数将在输出`output`文件(夹)的同时也会输出对应语种的文件,如`zh.json`。 | ||
4. 指定`locals`生成的语种文件中已做过翻译时,新生成的翻译不会覆盖原有已经翻译过的 key,`output`指定的文件则会覆盖。 | ||
- `test`生成的文件后缀前加`.lang`的新文件,如需删除可执行 `dev`/`prod`。 | ||
- 指定`locals`参数将在输出`output`文件(夹)的同时也会输出对应语种的文件,如`en`。 | ||
- `output`支持输出到文件或文件夹,文件支持`.js`和`.json`格式,指定文件夹则默认文件名为`local.json` | ||
- 指定`locals`生成的语种文件中已做过翻译时,新生成的翻译不会覆盖原有已经翻译过的 key,`output`指定的文件则会覆盖。 | ||
- 生成的翻译 key 默认为`文件名_[处理过的中文拼音]`,长度 < 50,中文修改后 key 会改变,这点需要注意 | ||
#### 常见翻译语种列表 | ||
#### 常见语种列表 | ||
| 语言名称 | 百度翻译代码 | 有道翻译代码 | Element Plus | 本项目中使用 | | ||
| -------- | ------------ | ------------ | ------------ | ------------ | | ||
| 简体中文 | zh | zh-CHS | zh-cn | zh | | ||
| 英语 | en | en | en | en | | ||
| 繁体中文 | cht | zh-CHT | zh-tw | zh-tw | | ||
| 日语 | jp | ja | ja | ja | | ||
| 韩语 | kor | ko | ko | ko | | ||
| 德语 | de | de | de | de | | ||
| 法语 | fra | fr | fr | fr | | ||
| 名称 | 百度翻译代码 | 有道翻译代码 | (Element Plus) | 本项目中使用 | | ||
| -------- | ------------ | ------------ | -------------- | ------------ | | ||
| 简体中文 | zh | zh-CHS | zh-cn | zh | | ||
| 英语 | en | en | en | en | | ||
| 繁体中文 | cht | zh-CHT | zh-tw | zh-tw | | ||
| 日语 | jp | ja | ja | ja | | ||
| 韩语 | kor | ko | ko | ko | | ||
| 德语 | de | de | de | de | | ||
| 法语 | fra | fr | fr | fr | | ||
### 自定义翻译字典 | ||
在根目录创建`translate.json`文件,添加自定义翻译对照,内包含的中文则会使用指定的 key 作为键,适用于项目高频率出现的中文,防止生成过多重复多语言,如下(默认 key 为`文件名_[处理过的中文拼音]`,所以不同文件相同中文会生成不同的 key,key 生成长度 < 50) | ||
在根目录创建`translate.json`文件,添加自定义翻译对照,内包含的中文则会使用指定的 key 作为键,适用于项目高频率出现的中文,防止生成过多重复多语言(不同文件相同中文会生成不同的 key),如下: | ||
@@ -71,0 +72,0 @@ ```json |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential malware
Supply chain riskAI has identified this package as malware. This is a strong signal that the package may be malicious.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
0
388
1
61018
8
1