Socket
Socket
Sign inDemoInstall

@mohaiyo/translate-hub

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @mohaiyo/translate-hub

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.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Translate Hub

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.

code style Alfy

English | 中文

Platform

Platformsupporteddescription
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

namevaluedescription
ALIBABA_CLOUD_ACCESS_KEY_IDIf you use Alibaba Cloud Translation, set the corresponding ACCESS KEY ID.
ALIBABA_CLOUD_ACCESS_KEY_SECRETIf you use Alibaba Cloud Translation, set the corresponding ACCESS KEY SECRET
OPENAI_API_KEYIf you use OpenAI, set the corresponding OpenAi Key
VOCAENGINE_ACCESS_KEY_IDIf you use Volcano Translation, set the corresponding ACCESS KEY ID
VOCAENGINE_ACCESS_KEY_SECRETIf you use Volcano Translation, set the corresponding ACCESS KEY SECRET
BAIDU_APP_IDIf you use Baidu Translation, set the corresponding APP ID
BAIDU_APP_SECRETIf 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.

  • alfy - Create Alfred workflows with ease

Keywords

FAQs

Last updated on 07 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc