npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tlm

v0.1.1

Published

Terminal packages that support multiple translation platforms

Downloads

14

Readme

多平台终端翻译包

Static Badge Static Badge Static Badge

一个简单的终端翻译包,支持多个翻译平台。通过终端命令,可以方便快捷的切换平台、语种,进行文本翻译操作。

语言

安装

npm install -g tlm

使用

Usage: tlm command [options]

Options:
  -v, --version                     输出当前版本
  -h, --help                        显示命令的帮助

Commands:
  ls [langs]                        列出所有翻译平台,在末尾输入“langs”以查看可以使用的语言代码
  use <name>                        更改当前的翻译平台
  set-trl [options] <name>          设置翻译平台访问渠道的应用ID和密钥
    -a, --appid <appid>             设置翻译平台应用ID
    -s, --secret-key <secretKey>    设置翻译平台密钥
  get-trl [options] [name]          显示指定平台的应用ID和秘钥,不指定则显示当前选中平台
    -s, --show                      显示真正的秘钥
  set-langs [options]               设置源语言和目标语言
    -s, --source <source>           设置源语言
    -t, --target <target>           设置目标语言
  p <query...>                      使用 'tlm p <query...>' 指令翻译文本
  help [command]                    显示命令的帮助

示例

$ tlm set-trl baidu -a 123456 -s abcdefghijklmnopqrstuvwxyz

  设置百度翻译平台的应用ID和密钥

$ tlm get-trl baidu -s 

  查看百度翻译平台的应用ID和秘钥

$ tlm use youdao
 
  使用有道翻译平台进行翻译

$ tlm ls

  查看翻译平台列表和当前选中的平台

$ tlm ls langs
  
  查看当前可以选择的源语言和目标语言代码
 
$ tlm set-langs -s en -t zh

  设置翻译源语言为英语,目标语言为中文
 
$ tlm p hello world

  tlm p 跟上需要翻译的文本内容

支持平台

  • 谷歌翻译
  • 百度翻译
  • 有道翻译
  • 腾讯云翻译
  • 阿里云翻译
  • 火山翻译

注意事项

  • 翻译插件本身并没有翻译文字的能力,而是通过调用翻译平台提供的API进行翻译,目前支持的平台都有免费的翻译额度,对于大部分人来说是完全足够的。
  • 除了谷歌翻译,所有翻译平台都需要去申请应用ID和密钥,具体申请教程请看:翻译平台API申请教程
  • 由于本插件是终端运行,也并没有提供服务器的打算,所以谷歌翻译需要通过代理才能使用,如果开启代理还不能使用,请开启代理的Tun模式。

联系

  • QQ 2452559902

贡献

欢迎提交 issue 和 pull request

许可证

MIT