TextTranslator

Text Translation package

translates the character string on Emacs. this packages use the text translation service that exists on the Internet.

Download

Please use launchpad version. Launchpad version of text-translator is development version.

EmacsWiki files are very old.

or

M-x auto-install-batch text translator if you have AutoInstall.

Quick use

(require 'text-translator)
(global-set-key "\C-x\M-t" 'text-translator)

You can translate text selected by region with C-x M-t.

You can also specify translator engine with prefix key like C-u C-x M-t google.com_jaen RET.

Configuration sample

put text-translator.el, text-translator-load.el and text-translator-vars.el to load-path.

use autoload

(require 'text-translator-load)

use require

;;;; not autoload, use require
(require 'text-translator)

change prefix key

;; set prefix-key to M-n
(setq text-translator-prefix-key "\M-n")

set global key

(global-set-key "\C-x\M-t" 'text-translator)
;; translate all sites.
;; for example, if you specify "enja", text-translator use google.com_enja, yahoo.com_enja, ... .
(global-set-key "\C-x\M-a" 'text-translator-all)

use translation type auto selection (english/japanese only)

;; set function that use auto selection
(setq text-translator-auto-selection-func
      'text-translator-translate-by-auto-selection-enja)
;; set global-key
(global-set-key "\C-xt" 'text-translator-translate-by-auto-selection)

Translation sites

Links

Comments

Great package. I recommend adding a function similar to M-$, which runs the command ispell-word. It would be great. Thanks!

Thank you for your comment.

I’ll think about it. – khiker

You could change to this function on text-translator it does something like what was last suggested:

(defun text-translator-region-or-thing-at-point (&optional prompt)
  "If mark is active, return the region, otherwise, thing at point."
  (cond
   (mark-active
    (buffer-substring-no-properties (region-beginning) (region-end)))
   (t
    (thing-at-point 'symbol ))))

Great package. Already available as a package in SliTaz GNU/Linux.


CategoryInterface CategoryInternationalization