-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加一点细节 :)
- Loading branch information
Showing
11 changed files
with
631 additions
and
547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
;;; go-translate.el --- Translation -*- lexical-binding: t -*- | ||
;;; go-translate.el --- Translation framework supports multiple engines such as Google/Bing/DeepL -*- lexical-binding: t -*- | ||
|
||
;; Copyright (C) 2021 lorniu <[email protected]> | ||
|
||
;; Author: lorniu <[email protected]> | ||
;; URL: https://github.com/lorniu/go-translate | ||
;; Package-Requires: ((emacs "26.1")) | ||
;; Package-Requires: ((emacs "27.1")) | ||
;; Keywords: convenience | ||
;; SPDX-License-Identifier: MIT | ||
;; Version: 0.2 | ||
;; Version: 2.0 | ||
|
||
;;; Commentary: | ||
|
||
;; First, Install it via MELPA or download from github. | ||
;; Make sure this is on your `load-path'. | ||
;; To be the most powerful translator on Emacs. Supports multiple translation engines such as Google, Bing, deepL. | ||
|
||
;; Then add following lines to your `.emacs': | ||
;; First, Install it via MELPA or download from github. Make sure this is on your `load-path'. | ||
|
||
;; (require 'google-translate) | ||
;; (setq gts-translate-list '(("en" "zh"))) | ||
;; (setq gts-default-translator | ||
;; (gts-translator | ||
;; :picker (gts-prompt-picker) | ||
;; :engines (list (gts-google-engine) (gts-google-rpc-engine)) | ||
;; :render (gts-buffer-render))) | ||
;; Then, add following lines to your `.emacs': | ||
|
||
;; Now you can start your translation with `gts-do-translate' command. | ||
;; (require 'go-translate) | ||
;; (setq gts-translate-list '(("en" "zh"))) | ||
;; (setq gts-default-translator | ||
;; (gts-translator | ||
;; :picker (gts-prompt-picker) | ||
;; :engines (list (gts-google-engine) (gts-google-rpc-engine)) | ||
;; :render (gts-buffer-render))) | ||
|
||
;; And start your translate with command `gts-do-translate'. | ||
|
||
;;; Code: | ||
|
||
|
@@ -45,40 +46,38 @@ | |
;;; Commands | ||
|
||
(defvar gts-default-translator | ||
(gts-translator | ||
|
||
:picker | ||
;;(gts-noprompt-picker) | ||
;;(gts-noprompt-picker :texter (gts-whole-buffer-texter)) | ||
|
||
(gts-prompt-picker) | ||
;;(gts-prompt-picker :single t) | ||
;;(gts-prompt-picker :texter (gts-current-or-selection-texter) :single t) | ||
|
||
:engines | ||
(list | ||
(gts-bing-engine) | ||
;;(gts-google-engine) | ||
;;(gts-google-rpc-engine) | ||
;;(gts-deepl-engine :auth-key "2e20bade-88e9-02f3-169f-ab3c445d7984:fx" :pro nil) | ||
|
||
;;(gts-google-engine :parser (gts-google-summary-parser)) | ||
;;(gts-google-engine :parser (gts-google-parser)) | ||
;;(gts-google-rpc-engine :parser (gts-google-rpc-summary-parser)) | ||
) | ||
|
||
:render | ||
(gts-buffer-render) | ||
|
||
;;(gts-posframe-pop-render) | ||
;;(gts-posframe-pop-render :backcolor "#333333" :forecolor "#ffffff") | ||
|
||
;;(gts-posframe-pin-render) | ||
;;(gts-posframe-pin-render :position (cons 1200 20)) | ||
;;(gts-posframe-pin-render :width 80 :height 25 :position (cons 1000 20) :forecolor "#ffffff" :backcolor "#111111") | ||
|
||
;;(gts-kill-ring-render) | ||
)) | ||
(gts-translator :picker | ||
(gts-prompt-picker) | ||
;;(gts-noprompt-picker) | ||
;;(gts-noprompt-picker :texter (gts-whole-buffer-texter)) | ||
|
||
:engines | ||
(list | ||
(gts-bing-engine) | ||
(gts-google-engine :parser (gts-google-summary-parser)) | ||
(gts-google-rpc-engine) | ||
|
||
;;(gts-google-engine) | ||
;;(gts-google-rpc-engine) | ||
;;(gts-deepl-engine :auth-key "2e20bade-88e9-02f3-169f-ab3c445d7984:fx" :pro nil) | ||
|
||
;;(gts-google-engine :parser (gts-google-summary-parser)) | ||
;;(gts-google-engine :parser (gts-google-parser)) | ||
;;(gts-google-rpc-engine :parser (gts-google-rpc-summary-parser)) | ||
) | ||
|
||
:render | ||
(gts-buffer-render) | ||
|
||
;;(gts-posframe-pop-render) | ||
;;(gts-posframe-pop-render :backcolor "#333333" :forecolor "#ffffff") | ||
|
||
;;(gts-posframe-pin-render) | ||
;;(gts-posframe-pin-render :position (cons 1200 20)) | ||
;;(gts-posframe-pin-render :width 80 :height 25 :position (cons 1000 20) :forecolor "#ffffff" :backcolor "#111111") | ||
|
||
;;(gts-kill-ring-render) | ||
)) | ||
|
||
;;;###autoload | ||
(defun gts-do-translate () | ||
|
Oops, something went wrong.