Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xuchunyang/translate-shell.el
Google Translate from Emacs by using https://github.com/soimort/translate-shell
https://github.com/xuchunyang/translate-shell.el
Last synced: about 1 month ago
JSON representation
Google Translate from Emacs by using https://github.com/soimort/translate-shell
- Host: GitHub
- URL: https://github.com/xuchunyang/translate-shell.el
- Owner: xuchunyang
- Created: 2015-06-20T06:24:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-26T06:45:19.000Z (over 9 years ago)
- Last Synced: 2024-10-16T01:45:56.171Z (3 months ago)
- Language: Emacs Lisp
- Size: 125 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# translate-shell.el
`translate-shell.el` is an unofficial Emacs front-end for
[translate-shell](https://github.com/soimort/translate-shell). translate-shell
is command-line translator powered by Google Translate.## Installations
To install manually, make sure this file is saved in a directory in your
`load-path`, and add the line:(require 'translate-shell)
to your Emacs initialization file.
## Usage
You can call `translate-shell-brief` and `translate-shell` to get the
definition your query word. The result will display in echo area and
"*Translate Shell*" buffer. You might want to bind them to some keys.## Cache
The result returned from `trans` (the translate-shell command-line program)
are stored in the `translate-shell-brief-cache` and `translate-shell-cache`
variable.If you want to use cache even after restarting Emacs, you need tt save these
two variable yourself. An easy solution is using `desktop.el`, see below.## Customization
Below is my customization around this package:
```elisp
(use-package desktop ; Save buffers, windows and frames
:init (desktop-save-mode)
:config
(add-to-list 'desktop-globals-to-save 'translate-shell-cache)
(add-to-list 'desktop-globals-to-save 'translate-shell-brief-cache))(use-package translate-shell
:load-path "~/wip/translate-shell.el"
:bind (("C-c s" . translate-shell-brief)
("C-c S" . translate-shell))
:config
;; is blocked in China for no apparent
;; reason. No one ever asked my option.
(setq translate-shell-command "proxychains4 -q trans -t en %s"
translate-shell-brief-command "proxychains4 -q trans -brief -t zh %s"))
```