manateelazycat / mind-wave

Emacs AI plugin based on ChatGPT API
GNU General Public License v3.0
159 stars 26 forks source link

It works but the output is in Chinese #10

Closed AddyLaddy closed 1 year ago

AddyLaddy commented 1 year ago

Maybe that's deliberate, but as someone who one speaks one language it's not very useful.

I eventually hacked the lisp and python files to get it back to English.

manateelazycat commented 1 year ago

https://github.com/manateelazycat/mind-wave/commit/f23965a2848a30e98462e895cb0f3997dfce84f4 fix this issue.

AddyLaddy commented 1 year ago

Great thanks for the quick fix! I still see one function you didn't change


(defun mind-wave-chat-continue ()
  (interactive)
  (mind-wave-chat-ask-with-message "继续"))
AddyLaddy commented 1 year ago

I also had to patch it further with

diff --git a/mind-wave.el b/mind-wave.el
index 64001f4..f49d075 100644
--- a/mind-wave.el
+++ b/mind-wave.el
@@ -88,12 +88,15 @@
   :type 'boolean
   :group 'mind-wave)

+(defun file-name-concat (&rest parts)
+  (reduce (lambda (a b) (expand-file-name b a)) parts))
+
 (defcustom mind-wave-api-key-path (expand-file-name (file-name-concat user-emacs-directory "mind-wave" "chatgpt_api_key.txt"))
   "The path to store OpenAI API Key."
   :type 'boolean
   :group 'mind-wave)

-(defvar mind-wave-lang (car (string-split (getenv "LANG") "\\.")))
+(defvar mind-wave-lang (car (split-string (getenv "LANG") "\\.")))

 (defvar mind-wave-server nil
   "The Mind-Wave Server.")
manateelazycat commented 1 year ago

Done, thanks for patch.

Ethanlinyf commented 1 year ago

It is recommended to modify the "reduce" function to "cl-reduce" from the "cl-lib" library in order to avoid encountering the error message, "Symbol's function definition is void: reduce".

manateelazycat commented 1 year ago

Done