当前位置: 首页 > news >正文

黄山网站推广公司semir是什么牌子衣服

黄山网站推广公司,semir是什么牌子衣服,有没有免费的seo网站,网页设计模板图片并排显示Unity3D特效百例案例项目实战源码Android-Unity实战问题汇总游戏脚本-辅助自动化Android控件全解手册再战Android系列Scratch编程案例软考全系列Unity3D学习专栏蓝桥系列ChatGPT和AIGC #x1f449;关于作者 专注于Android/Unity和各种游戏开发技巧#xff0c;以及各种资源分…Unity3D特效百例案例项目实战源码Android-Unity实战问题汇总游戏脚本-辅助自动化Android控件全解手册再战Android系列Scratch编程案例软考全系列Unity3D学习专栏蓝桥系列ChatGPT和AIGC 关于作者 专注于Android/Unity和各种游戏开发技巧以及各种资源分享网站、工具、素材、源码、游戏等 有什么需要欢迎底部卡片私我获取更多支持交流让学习不再孤单。 实践过程 const fs require(fs) const path require(path) const fanyi require(./utils/fanyi) const cache require(./utils/cache) const render require(./render); const tools require(./tools)const translate (list, listIndex 0) {const listLen list.lengthconsole.log(listIndex, /, listLen);if (listIndex listLen) {console.log(完毕);return;}const suffix tools.getFileSuffix(list[listIndex]);const jsonFile list[listIndex].replace(. suffix, .json)console.log(正在翻译:, listIndex, /, listLen, jsonFile);const texts require(jsonFile)const total texts.lengthconsole.log(总条数, total);const writeFile (data) {fs.writeFileSync(jsonFile, JSON.stringify(data, null, 2));}const translation async (index) {if (index texts.length) {const current texts[index - 1]const {origin, local} currentif (local) {console.log(${index}/${total} ${origin} 已翻译了- ${local})translation(index 1)return}const hasLocal cache.get(origin)if (hasLocal) {current.local hasLocalconsole.log(${index}/${total} ${origin} 已缓存了- ${hasLocal})writeFile(texts);translation(index 1)} else {current.local await fanyi(origin)cache.set(origin, current.local)writeFile(texts);setTimeout(() {translation(index 1)}, 1000)console.log(${index}/${total} ${origin} API翻译- ${current.local})}} else {console.log(${index}/${total} 完成)writeFile(texts);render(list[listIndex], jsonFile);translate(list, listIndex 1);}}translation(1); }const configTranslate (filename){try {const config require(filename);for (val of config.translation){console.log(自定义译文,val.name,val.value);cache.set(val.name,val.value);}}catch (e) {console.log(自定义译文,e);} }module.exports {translate: translate,configTranslate,configTranslate }const fs require(fs); const fse require(fs-extra); const path require(path); const getFileSuffix (filename){const spl filename.split(.);return spl[spl.length-1]; }//同步拷贝目录 const copyFolder (copiedPath, resultPath) {if (fs.existsSync(resultPath)) {fse.removeSync(resultPath)}fs.mkdirSync(resultPath);if (fs.existsSync(copiedPath)) {fse.copySync(copiedPath, resultPath)} else {console.log(这个目录不存在:, copiedPath);} }//获取所有html或htm const getList (dir ) {if (dir ) {console.log(请输入目录);return;}let files fs.readdirSync(dir);let list [];files.forEach(async (item, index) {let fPath path.join(dir, item);let stat fs.statSync(fPath);if (stat.isDirectory() true) {let sublist getList(fPath);sublist.forEach(file {list.push(file);})}if (stat.isFile() true) {if (fPath.slice(-4) html || fPath.slice(-3) htm) {list.push(fPath);}}});return list; } module.exports {getFileSuffix:getFileSuffix,getList:getList,copyFolder:copyFolder }const fs require(fs) const path require(path) const lodash require(lodash) const render require(posthtml-render) const html2texts require(./utils/html2texts)module.exports (htmlfile, jsonfile) {const html fs.readFileSync(htmlfile).toString()const texts require(jsonfile)const { texts: originTexts, tree } html2texts(html)originTexts.forEach((item, index) {lodash.set(tree, item.paths, texts[index].local)})const newHtml render(tree)try {fs.writeFileSync(htmlfile, newHtml)console.log(还原文件成功, htmlfile)}catch (e){console.log(还原文件失败, htmlfile)} }const fs require(fs) const path require(path) const html2texts require(./utils/html2texts) const tools require(./tools)module.exports (file) {const filepath file;const suffix tools.getFileSuffix(filepath);const outpath filepath.replace(.suffix, .json)if(fs.existsSync(outpath)){return ;}const html fs.readFileSync(filepath).toString()const { texts } html2texts(html)const localTexts texts.map(({ text }) {return { origin: text, local: }})fs.writeFileSync(outpath, JSON.stringify(localTexts, null, 2));console.log(生成待翻译,outpath)return outpath; } #!/usr/bin/env node const fs require(fs) const path require(path); const parse require(./lib/parse); const translate require(./lib/translate); const tools require(./lib/tools);let dirname process.argv[2]; //项目名 let fileIndex process.argv[3] || 0; //从第几个开始 const config require( path.join(process.cwd(), config.json));if(!config.appid || !config.secret){console.error(请配置appid and secret)return; } if(!dirname){console.error(请输入翻译文件夹 );console.log(npm run [dirname]);console.log(-----------------------------------);console.log(请将项目文件放在本目录的html中);console.log(示例:);console.log(html/nodejs);console.log(html/php8);return; }let dir path.join(process.cwd(), html, dirname);//目标目录 let outDir dir _zh_cn;if(!fs.existsSync(outDir)){tools.copyFolder(dir, outDir); } let list tools.getList(outDir); translate.configTranslate(dir/config.json)//生成json list.forEach(file {console.log(html,file)parse(file); }); translate.translate(list,fileIndex);const dayjs require(dayjs) const parser require(posthtml-parser)module.exports html {const texts []const tree parser(html)const transform (node, paths ) {const isStyle node.tag styleconst isScript node.tag scriptconst isPre node.tag preconst isCode node.tag codeif (isStyle || isScript || isCode || isPre) returnconst { placeholder } node.attrs || {}const hasPlaceholder !!placeholderif (hasPlaceholder) {transform(placeholder, ${paths}.attrs.placeholder)return}const hasContent !!node.contentif (hasContent) {node.content.forEach((item, index) {transform(item, ${paths}.content[${index}])})return}const isString typeof node stringif (!isString) returnconst text node.replace(/\s/g, ).trim()const isEmpty !textif (isEmpty) returnconst isDOCTYPE !!text.match(/!DOCTYPE/)const isDOCTYPE2 !!text.match(/!doctype/)const isComment !!text.match(/!--/)if (isDOCTYPE || isComment || isDOCTYPE2) returnconst isDate dayjs(text).isValid()const isDivider text |if (isDate || isDivider) returntexts.push({ paths, text })}tree.forEach((item, index) transform(item, [${index}]))return { tree, texts } } 其他 作者小空和小芝中的小空 转载说明-务必注明来源https://zhima.blog.csdn.net/ 这位道友请留步☁️我观你气度不凡谈吐间隐隐有王者霸气日后定有一番大作为旁边有点赞收藏今日传你点了吧未来你成功☀️我分文不取若不成功⚡️也好回来找我。
http://www.zqtcl.cn/news/387763/

相关文章:

  • 运动服装商城网站建设引流推广
  • 武进区城乡建设局网站聊城商城网站建设
  • 做网站开发赚钱吗网站建设电子书资料
  • wordpress 回收站在哪个文件夹建站之星模板好吗
  • 怎么用dw做博客网站天使投资平台官网
  • 淮安市网站建设crm网站
  • 门户网站主要特点和功能深圳地铁优化
  • 银川网站推广方式湖南建工交通建设有限公司网站
  • 知道网站域名怎么联系怎么创建自己的公司网站
  • 淘宝网站开发多少金额网站优化 福州
  • 百度推广让我先做虚拟网站后进一步优化落实
  • 好的网站建设启示汕头网页设计网站方案
  • 深圳网站制作开发免费精准客户软件
  • 网站超链接用什么南宁行业平台开发公司
  • 注册门户网站襄樊seo快速排名
  • 优秀的手机网站iis 设置此网站的访问权限
  • 用nat123做自己的网站深圳市建设工程质量检测中心官网
  • 网上做衣服的网站废旧网站哪个做的最好
  • 网站开发设置网页端口wordpress 知识库
  • 网站建设的方法有四种开发一款新闻app需要多少钱
  • 成都网站建站公司2023年防疫新政策
  • 17做网店一样的网站十大互联网培训机构
  • 中企网络科技建站施工企业oa办公系统
  • 成都网站推广公司排名淘宝商家网站建设
  • 平台网站建设报价网站建设企业蛋糕
  • 上海创意网站建设电子商务毕业设计网站建设
  • 如何让网站打不开 解析wordpress pdf检索
  • 网站建设大作业感想台州企业网站模板建站
  • 淄博网站的优化上海营销网站建站公司
  • 长春网站建设硕成传媒长春电商网站建设哪家好