やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

transコマンドをインストールする(Google翻訳CLI)

 Google翻訳するCLI

情報確認

$ apt show translate-shell
Package: translate-shell
Version: 0.9.6.9-1
Priority: optional
Section: contrib/misc
Maintainer: Andreas Tille <tille@debian.org>
Installed-Size: 224 kB
Provides: google-translate-cli
Depends: gawk, libfribidi-bin
Recommends: curl, rlwrap, aspell | hunspell, less | most
Suggests: mplayer | mpv | mpg123 | espeak
Conflicts: google-translate-cli
Replaces: google-translate-cli
Homepage: https://github.com/soimort/translate-shell
Download-Size: 55.3 kB
APT-Sources: http://ftp.jaist.ac.jp/raspbian buster/contrib armhf Packages
Description: Command-line translator using Google Translate, etc.
 Translate Shell (formerly Google Translate CLI) is a command-line
 translator powered by Google Translate (default), Bing Translator,
 Yandex.Translate, DeepL Translator and Apertium. It gives you easy
 access to one of these translation engines in your terminal.

 aptにある。以前はコードをビルドして自分で配置していたのに。改善された。ありがとう。ちょっと古いけど気にしない。

手順

sudo apt install -y translate-shell

使ってみる

trans -b en:ja 'My name is Andy.'
 trans -sp 'なんかしゃべる'

対象環境

$ uname -a
Linux raspberrypi 5.10.17-v7l+ #1421 SMP Thu May 27 14:00:13 BST 2021 armv7l GNU/Linux