translate-mds
v4.0.5
Published
translate [folder/single] md file language to you want
Downloads
1,087
Readme
translate .md to *.md
like
.md to .「all-language」.md
life
help me live , live need money 💰
- This project is for all-of-markdown-writing-files translation
工具
- Demo
- Command line options
- My-translate-list
- common problem
- Tips
- characteristic
- Split Code
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
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-D
Debug /-F
Force write to file / Adjust unusual characters
Tips
- Diff file type, may try pandoc converter
- May use cli without
-f **
,causetranslation.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
[x] Improve the accuracy of md format such as http
[x] Automatic translation
[x] Enable md AST
Split Code
Useremark
Improve accuracy
Usetranslation.js
Complete interaction with the translation website
There is anotherAsynchronous Promise recursive example