Terminalから翻訳しよう
変数名やメソッド名をどうしようかと悩んでgoogle翻訳等を使うことがあると思います。
ですがブラウザに移動するのは面倒です。ターミナルで翻訳できないかと思い、探したところ便利なものを見つけました。
それがこちらです。
soimort/translate-shell · GitHub
Homebrewでインストールできます。
brew install https://www.soimort.org/translate-shell/translate-shell.rb
使い方は簡単でtransコマンドの後に翻訳したい言葉を入力するだけです。
$ trans 翻訳 翻訳 (Hon'yaku) translation Definitions of 翻訳 [ 日本語 -> English ] noun translation 翻訳, 訳書, 翻訳物, トランスレーション deciphering 解読, 翻訳
英語から日本語にするには以下のようにtrans :jaとすればokです。
$ trans :ja translation translation /transˈlāSHən,tranz-/ 翻訳 (Hon'yaku) Definitions of translation [ English -> 日本語 ] noun 翻訳 translation, deciphering 訳書 translation 翻訳物 translation トランスレーション