Skip to content
/ bf Public

bf is a translation tool, based on baidu translate api, that used in command line

License

Notifications You must be signed in to change notification settings

CiroLee/bf

Repository files navigation

logo

bf

bf(Baidu Fanyi) is a translation tool, based on baidu translate api, that used in command line



logo


Install

npm install bf-translate -g

Usage

bf --help // or bf -h

// output

Usage bf [options] <query>

-v,--version        output the version number
-h,--help           show help info
-lang,--language    output the list of supported languages
--from [lang]       the source language
--to [lang]         the target language
--cases [c|p|k|s|all]   convert the result using the cases

bf is friendly to chinese-english translation. If your queries include Chinese, and without target language(--to), bf will regart queries as Chinese and translates it to English. Otherwise use --from(default is auto) and --to(default is auto) sets

bf hello, 吃饭了吗?

- Hello, have you eaten yet?

Also, you can use cases param to convert the result via the case you input. Now it supports c(camelCase), p(PascalCase), s(snake_case) and k(kebab-case), if you want to output all cases you can just use all for the case.

demo

About

bf is a translation tool, based on baidu translate api, that used in command line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published