Skip to content

Latest commit

 

History

History
153 lines (103 loc) · 5.78 KB

README.en.md

File metadata and controls

153 lines (103 loc) · 5.78 KB

translate .md to *.mdexplain install size

like

.md to .「all-language」.md

english


Build Status codecov GitHub license npm GitHub release

life

help me live , live need money 💰


This project is for all-of-markdown-writing-files translation工具

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

//or single file

translateMds test.md

Demo

demo

Command line options

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 detect >
    -t   to       : default < zh >
    -N   num      : default < 1 > {async number}
    -R   rewrite  : default < false > {yes/no rewrite translate file}

  🌟[high user options]❤️

    -D   debug
    -C   cache              : default: false  cache in disk
    -G   google.com         : default: false  { cn => com with Google api }
    -F   force              : default: false  { If, translate result is no 100%, force wirte md file }
    -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"] {pass the md AST type}
    --timewait              : default < 80 > {each fetch api wait time}
    --values [path]         : default: false {write the original of wait for translate file} [single file]
    --translate [path]      : default: false {use this file translate} [single file]
    --text-glob [pattern]   : default: false {text must be match, then be transalte}
    --no-disk               : default: false {do not use cached Result}
    --cache-name [filename] : default: "translateMds" named the cache file
    --glob [pattern]        : default: false {file must be match, then be transalte}
    --ignore [relative file/folder] : default: false {ignore files/folders string, split with `,` }

My-translate-list

Project test translation listorMore Chinese 🇨🇳 translation list

common problem

1. Sometimes the wind will get stuck and stagnate.

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

The problem comes from the API, you just have to run it again.

2. There are a number of totals that have not been translated successfully

Quantity is no translation success / total is the total number of single file translations

This problem occurs, usually from the shift of characters caused by unusual symbols or sentences that are too long.

At this time, you can use-DDebug /-FForce write to file / Adjust unusual characters

Specific can be seen

Tips

  1. Diff file type, may try pandoc converter
  2. May use cli without -f **,cause translation.js auto detect language
  • --timewait [number] can lengthen the time of each request translation, reduce the banned ip
  • --values [file-path] (single file usage) to get the original output file to be translated
  • --translate [file-path] (single file usage) replaces the request api and uses the translated content of this file instead

Welcome 👏 ISSUE and PULL

characteristic

  • Improve the accuracy of md format such as http

  • Automatic translation

  • Enable md AST

Split Code


UseremarkImprove accuracy

Usetranslation.jsComplete interaction with the translation website

There is anotherAsynchronous Promise recursive example