Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Translate text by google, bing, youdaozhiyun, haici, stardict, openai, large language model of local machine, etc at same time from CLI, GUI (GNU/Linux, Android, macOS and Windows), REPL, python, shell and vim.
Translate text by:
Supports:
trans --translators=google,bing,haici,stardict crush
$ trans # enter REPL
> en:ja # change source language to english and target language to japanese
> : # swap source and target languages
> =stardict # use stardict to translate text
> !cat example/test.txt # execute a shell command
ハッカー
> <example/test.txt # translate a file
hacker
> 画家 # translate text
painter; artist
> ! # enter shell
$ echo $SHELL # execute a shell command
/usr/bin/zsh
$ exit # exit shell
>
Translate --translators=google,bing Free as in Freedom
>>> from translate_shell.translate import translate
>>> translate("The Mythical Man-Month", "zh_TW")
... Translations(
... status=1,
... results=[
... Translation(
... translator="google",
... sl="auto",
... tl="zh_TW",
... text="The Mythical Man-Month",
... phonetic="",
... paraphrase="神話般的人月",
... explains={},
... details={},
... alternatives=["神話般的月"]
... )
... ],
... text="The Mythical Man-Month",
... to_lang="zh_TW",
... from_lang="auto",
... )
$ xsel -o | trans --format json | jq -r '"《\(.results[].paraphrase)》的英文是 \(.text)."'
《大教堂和集市》的英文是 the cathedral and the bazaar.
:let g:text = 'Just for Fun'
:let g:translation = json_decode(translate_shell#call('--format=json', g:text))
:echo g:text 'is' g:translation.results[0].paraphrase 'in Chinese.'
Just for Fun is 纯娱乐 in Chinese.
This repo provides an action to translate *.po
of a repository. See
inputs.
For example, you have a repository which contains translations of another
project's documents (upstream), you can write a github workflow to detect if
upstream has update. If a new version exist, update the version and
generate new
.po
s,
then translate the changed .po
s and git commit
.
Examples:
on:
schedule:
# Run this CI/CD at 0:00 on Friday
- cron: 0 0 * * 5
workflow_dispatch:
jobs:
translate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate new .po
id: version
run: |
# update version
# then use perl / sed / ... to replace the version string of your file
# then generate new .po
echo VERSION=XXX > $GITHUB_OUTPUT
- name: Translate your *.po
uses: Freed-Wu/translate-shell@main
- name: Git commit
run: |
git add **.po
git config --global user.name 'Github Actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git commit -m ":bookmark: Dump version to $VERSION"
git tag "$VERSION"
git remote set-url origin "https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY"
git push
git push --tags
env:
VERSION: ${{steps.version.outputs.VERSION}}
GH_TOKEN: ${{secrets.GH_TOKEN}}
You can use the following commands to get the new version:
# get a github repo's version:
curl https://api.github.com/repos/user/repo/releases/latest | jq -r .tag_name
# get a gitlab repo's version
curl 'https://gitlab.com/api/v4/projects/41218592/repository/tags?per_page=1' |
jq -r '.[].name'
You can use the following tools to generate the new .po
s:
.po
for any
project using sphinx to generate document..po
for any project which use markdown,
LaTeX
, man, ... to write document.See comparison.
en:
to change source language, :zh_CN
to change target
language, <file
to translate file, etc.config.py
man trans
The last but not least: it is a libre software.
See document to know more.
PS: PR is welcome! Please make code clean and keep test pass!
FAQs
Translate text by google, bing, youdaozhiyun, haici, stardict, openai, large language model of local machine, etc at same time from CLI, GUI (GNU/Linux, Android, macOS and Windows), REPL, python, shell and vim.
We found that translate-shell demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.