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

@mohaiyo/translate-hub

v0.1.1

Published

Utilize the translation API or AI capabilities on the cloud platform, combined with the Alfred workflow, to achieve rapid translation and enhance your work efficiency.

Downloads

19

Readme

code style Alfy

English | 中文

Platform

| Platform | supported | description | | :-------------------------: | :----------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Aliyun Translation | :white_check_mark: | The first 1 million characters per month are free for the General Edition of machine translation. Charges of 50 RMB per million characters will apply for any exceeding usage.document,price | | OpenAI | :white_check_mark: | OpenAI API Key apply | | MicroSoft Azure Translation | :x: | Translation of up to 2 million words per month is free. If you exceed 2 million words monthly, charges will apply at a rate of $10 per million words. For further details, please consult the official pricing documentation.。document | | Baidu Translation | :white_check_mark: | Provide standard version, advanced version, exclusive version of the service, complete identity authentication, enjoy a maximum of 2 million free characters per month。document | | Volcano translation | :white_check_mark: | Volcano translation is free of charge for the first 2 million characters per month, and the excess will be charged according to 49 RMB per million characters.。document |

Installation

You need Node.js 18+ and Alfred 4 or later with the paid Powerpack upgrade.

Install with NPM

npm install -g @mohaiyo/translate-hub

Install with pnpm.

pnpm install -g @mohaiyo/translate-hub

Manually

download the workflow

Changelog

Change Log

Usage

How to set up an API platform

Open Alfred and enter trc use [openai]. you can see the built-in platform and select the platform you want to use. the built-in platform is aliyun.

How to set the target language

Open Alfred and enter trc target [english]. You can see the built-in target language options, select the target language you want to translate into, the built-in is English (en).

How to use the translation function

Before using, set the API KEY for the platform you want to use. How to set, please see Environment variables

Open Alfred and type tr [enter the word or statement you want to translate]. For example: tr 谁是世界上最可爱的人儿?

Press the enter key or the cmd C key to copy the translated text to the clipboard.

Press the cmd L key to display the translation in large text.

Environment Variables

| name | value | description | | :-----------------------------: | :---: | :---------------------------------------------------------------------------: | | ALIBABA_CLOUD_ACCESS_KEY_ID | | If you use Alibaba Cloud Translation, set the corresponding ACCESS KEY ID. | | ALIBABA_CLOUD_ACCESS_KEY_SECRET | | If you use Alibaba Cloud Translation, set the corresponding ACCESS KEY SECRET | | OPENAI_API_KEY | | If you use OpenAI, set the corresponding OpenAi Key | | VOCAENGINE_ACCESS_KEY_ID | | If you use Volcano Translation, set the corresponding ACCESS KEY ID | | VOCAENGINE_ACCESS_KEY_SECRET | | If you use Volcano Translation, set the corresponding ACCESS KEY SECRET | | BAIDU_APP_ID | | If you use Baidu Translation, set the corresponding APP ID | | BAIDU_APP_SECRET | | If you use Baidu Translation, set the corresponding APP SECRET |

environment variables screenshots

env config env variable

Hotkey

If you download the workflow, you may have to manually set the hotkeys yourself.

trc hotkey hotkey config

Screenshots

trc use trc use trc use

FAQ

Q: Why does the translation fail after setting the target language from the built-in language list?

The built-in languages are supported by aliyun by default. the translation languages supported by different platforms vary.

Related

  • alfy - Create Alfred workflows with ease