Emacs plug in (1) — Google translation


1、 Reference

Contents of Emacs series articles — updating
New Google translation plugin

2、 Installation

2.1 installation package

m-x package-install go-translate RET

2.2 custom configuration

(1) Configure Google Translate domestic address

(setq go-translate-base-url "https://translate.google.cn") 

(2) Set translation language

(setq go-translate-local-language "zh-CN")

(3) Mac configuration

(defun go-translate-token--extract-tkk ()                                     
    (cons 430675 2721866130))

Solve the problem of error reporting

user-error: Error when fetching Token-Key. Check your network and proxy, or retry later

3、 Use

3.1 go translate command

The most important command is to translate the text in the marked range

Can be bound as other shortcut keys

(global-set-key (kbd "M-t") 'go-translate)

Recommended Today

[rust] basic data type

This article introduces the built-in data types provided by rust. Boolean type Boolean typeLogical values representing yes and No. It has two values:trueandfalseGenerally used in logical expressions, and, or, and not operations can be performed: fn main() { let x = true; let y: bool = ! x; // False, inverse operation let z = […]