commit 53a28cbb27015b983f8cd4a1b3335737d5390052
parent 866329135c0f9d392f10d03134c545e2e5e6a331
Author: andsy10 <andsy1016@gmail.com>
Date: Wed, 5 Aug 2026 21:28:12 +0800
Add gt translator integration
Diffstat:
5 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/lisp/init-kbd.el b/lisp/init-kbd.el
@@ -379,7 +379,8 @@
;; other
"C-x r b" #'consult-bookmark
"C-;" #'embark-act
- "M-s M-b" #'eww-list-bookmarks)
+ "M-s M-b" #'eww-list-bookmarks
+ "C-c x g" 'gt-translate)
(cond
(*is-android*
diff --git a/lisp/init-package.el b/lisp/init-package.el
@@ -224,5 +224,16 @@ _a_ : all dwim
:config
(setq elfeed-curl-timeout 600))
+;; translator
+(use-package gt
+ :bind
+ (([remap gt-buffer-render--keyboard-quit] . keyboard-quit))
+ :config
+ (setq gt-default-translator
+ (gt-translator
+ :engines (gt-youdao-dict-engine)
+ :taker (gt-taker :text 'word :langs '(en zh))
+ :render (gt-buffer-render))))
+
(provide 'init-package)
;;; init-package.el ends here
diff --git a/lisp/init-window.el b/lisp/init-window.el
@@ -85,6 +85,7 @@
"\\*eldoc\\*"
;; "^\\*elfeed-entry\\*$"
"^\\*macro expansion\\**"
+ "\\*gt-result\\*"
"\\*Agenda Commands\\*" "\\*Org Select\\*" "\\*Capture\\*" "^CAPTURE-.*\\.org*" "^CAPTURE-" "\\*Org Note\\*"
"\\*Gofmt Errors\\*$" "\\*Go Test\\*$" godoc-mode
diff --git a/lisp/my-dark-theme.el b/lisp/my-dark-theme.el
@@ -159,7 +159,10 @@
`(syncthing-progress-75 ((,class (:foreground ,cyan))))
`(syncthing-progress-50 ((,class (:foreground ,yellow))))
`(syncthing-progress-25 ((,class (:foreground ,orange))))
- `(syncthing-progress-0 ((,class (:foreground ,red)))))))
+ `(syncthing-progress-0 ((,class (:foreground ,red))))
+
+ `(gt-buffer-render-source-face ((,class (:inherit font-lock-string-face))))
+ `(gt-youdao-dict-phonetic-face ((,class (:inherit italic)))))))
(provide-theme 'my-dark)
;;; my-dark-theme.el ends here
diff --git a/lisp/my-light-theme.el b/lisp/my-light-theme.el
@@ -158,7 +158,10 @@
`(syncthing-progress-75 ((,class (:foreground ,cyan))))
`(syncthing-progress-50 ((,class (:foreground ,yellow))))
`(syncthing-progress-25 ((,class (:foreground ,orange))))
- `(syncthing-progress-0 ((,class (:foreground ,red)))))))
+ `(syncthing-progress-0 ((,class (:foreground ,red))))
+
+ `(gt-buffer-render-source-face ((,class (:inherit font-lock-string-face))))
+ `(gt-youdao-dict-phonetic-face ((,class (:inherit italic)))))))
(provide-theme 'my-light)
;;; my-light-theme.el ends here