translate-mds

4.0.5 • Public • Published

translate .md to *.md explain install size

like

.md to .「all-language」.md

english


Build Status codecov GitHub license npm GitHub release

生活

help me live , live need money 💰


这个项目是 为了 所有-的-markdown-编写-文件 📃 翻译 的 工具

npm install -g translate-mds
// all folder·
translateMds md/

//or single file

translateMds test.md

Demo

demo

命令行选项

  translate [folder/single] md file language to you want

  Usage
    $ translateMds [folder/file name] [options]

  Example
    $ translateMds md/

    [options]
    -a   API      : default < baidu > {google|baidu|youdao}
    -f   from     : default < auto 检验 >
    -t   to       : default < zh >
    -N   num      : default < 1 > {并发 数}
    -R   rewrite  : default < false > {yes/no 重新写入翻译}

  🌟[high user options]❤️

    -D   debug
    -C   cache                    : default: false  是否存储结果
    -G   google.com               : default < false > { cn => Google.com 的 api }
    -F   force                    : default < false > { 当, 翻译的结果达不到 100%, 强行写入翻译文件 }
    -M   match                    : default [ ". ", "! "//...] {match this str, merge translate result }
    -S   skips                    : default ["... ", "etc. ", "i.e. "] {match this str will, skip merge translate result}
    -T   types                    : default ["html", "code"] {过滤 AST 类型, 不翻译}
    --timewait                    : default: 80 { 每次请求的等待 80ms 时间}
    --values [path]               : default: false {取出原文中需要翻译的文本,放入path文件} [single file])
    --translate [path]            : default: false {使用此path文件替代请求网络翻译, 可搭配--values使用} [single file]
    --text-glob [pattern]         : default: false {文本匹配glob模式, 才能被翻译}
    --no-disk                     : default: false {do not use cached Result}
    --cache-name [filename]:      : default: "translateMds" 存储的文件名
    --glob [pattern]              : default: false {文件匹配glob模式, 才能被翻译}
    --ignore [relative file/folder] : default: false {忽略 文件/文件夹 字符串匹配, 可用`,`分隔多路径 }

My-translate-list

项目测试翻译列表 or 更多中文 🇨🇳 翻译列表

常见问题

1. 有时会抽风会卡住,停滞

If slow , may be you should try again or use -D

问题来自 API, 你只要再运行.

2. 没翻译成功的有 数量/总数

数量是 没有翻译成功/总数是 单个文件翻译总数

出现这样的问题, 一般是来自 不常见符号/或句子过长 导致的 字符移位.

这个时候, 你可以使用 -D 调试 / -F 强制写入文件 / 调整不常见的字符

具体可看

Tips

  1. 不同的文件格式, 使用pandoc 转换看看
  2. 不要-f **指定语言,translation.js会自动检测
  • --timewait [number] 可以拉长每次请求翻译的时间, 减少被禁 ip
  • --values [file-path] (单个文件使用) 获得将要翻译的原本输出文件
  • --translate [file-path] (单个文件使用) 取代请求 api, 改为使用此文件的翻译内容

欢迎 👏 ISSUE 和 PULL

特性

  • [x] 提高 http 之类的 md 格式准确率
  • [x] 自动换 翻译源
  • [x] 启用 md AST

已分隔的代码


使用 remark 提高精准度

使用 translation.js 完成 与翻译网站的交互

还有个 异步 Promise 递归的 例子

Readme

Keywords

Package Sidebar

Install

npm i translate-mds

Weekly Downloads

509

Version

4.0.5

License

ISC

Unpacked Size

77.6 kB

Total Files

23

Last publish

Collaborators

  • yobrave1995