0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VivaldiでGoogleのページ翻訳を簡単に使う

Posted at

目的

Vivaldiには標準で翻訳機能がついているが、Chromeなどに搭載されるGoogle翻訳に及ばない。
単一語句の翻訳であればあまり気にならないが、ページ全体の翻訳などでは粗が目立ち、これを回避するたびに毎回Chromeを開き直すのが面倒なのでVivaldi内で完結できるようにする。

解決法

Vivaldiのコマンドチェイン機能を使ってJavascriptコードを実行する。
脳死ChatGPTコードコピペだけど機能してるから許してほしい。

手順

  1. 「設定」から「クイックコマンド」を開く

  2. コマンドチェイン項目で新規項目を「+」から追加し、適当な名前をつける(今回translate)
    image.png

  3. Command1を「現在のタブでリンクを開く」にして次のコードをコピペ

     javascript: (() => { const currentURL = location.href; const translateURL = `https://translate.google.com/translate?sl=en&tl=ja&u=${encodeURIComponent(currentURL)}`; window.open(translateURL, '_blank'); })();
    
  4. 任意の英字ページ上でF2などを押してクイックコマンドを起動。その後先程の名前を検索(translate等)を探して実行

コマンドチェインはマウスジェスチャやショートカットに登録できるので毎回検索->実行しなくてもよくなる。

また、実行コード内のURL「sl=en」や「tl=ja」を変更すると英語->日本語に限らず翻訳ができる。

最後に

これでVivaldiがまた強くなってしまったね。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?