Fix lirve--set-translation

This commit is contained in:
Andros Fenollosa 2024-02-20 12:02:45 +01:00
parent 7029385d1e
commit efafde487f
2 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ Shows the translation of the verb when resolving or failing.
Only available in Spanish (at the moment).
```elisp
(setq lirve--show-translation 'es)
(setq lirve--set-translation 'es)
```
I also recommend creating a function to make it easier to remember the command.

View File

@ -30,6 +30,7 @@
(defvar lirve--verb-to-learn-simple-past nil)
(defvar lirve--verb-to-learn-past-participle nil)
(defvar lirve--translation "")
(defvar lirve--set-translation) ;; Set the translation language
(defvar lirve--emoji-valid "")
(defvar lirve--emoji-error "👎")
(defvar lirve--widget-title nil)
@ -153,7 +154,7 @@ Argument INFINITIVE verb to remove."
(setq lirve--verb-to-learn-infinitive (cdr (assq 'infinitive verb-to-learn)))
(setq lirve--verb-to-learn-simple-past (cdr (assq 'simple-past verb-to-learn)))
(setq lirve--verb-to-learn-past-participle (cdr (assq 'past-participle verb-to-learn)))
(when (not (null (boundp 'learning-irregular-verbs-in-English--show-translation))) (setq lirve--translation (cdr (assq lirve--show-translation (cdr (assq 'translations verb-to-learn))))))
(when lirve--set-translation (setq lirve--translation (cdr (assq lirve--set-translation (cdr (assq 'translations verb-to-learn))))))
;; Remove the verb from the list
(when (not turn-unresolved)
(setq lirve--verbs-shuffle (cdr lirve--verbs-shuffle))))