Fix issue with type of argument passed, simplify some code

This commit is contained in:
Lucien Cartier-Tilet 2021-11-30 20:11:05 +01:00
parent c1ee222337
commit 02d8717f18
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 3 additions and 3 deletions

View File

@ -268,9 +268,9 @@ second is the Runic equivalent.")
(defun conlanging--translate (text table)
"Translate TEXT through its correspondance TABLE."
(dolist (elem table)
(setq text (replace-regexp-in-string (car elem) (cdr elem) text)))
text)
(let ((rune-table (cdr (assoc table conlanging-language-list))))
(dolist (elem rune-table text)
(setq text (replace-regexp-in-string (car elem) (cdr elem) text)))))
(defun conlanging--replace-region-by-translation (table)
"Replace region with its translation through TABLE.