Skip to content
Snippets Groups Projects
Commit 236cc883 authored by Daniel Kochmański's avatar Daniel Kochmański
Browse files

add-single-translation: refactor function and fix missing-translations


Little function refactor. Removes added phrase from missing
translations table.

Signed-off-by: default avatarDaniel Kochmański <daniel@turtleware.eu>
parent 86f73c60
No related branches found
No related tags found
No related merge requests found
......@@ -36,13 +36,16 @@ corresponding objects."
If LANGUAGE doesn't exist, it is implicitly created and a warning is
emmited."
(check-type phrase string)
(let ((dict (car (or (getf *translations* language)
(progn
(warn "Implicitly creating language ~A." language)
(define-language language)
(getf *translations* language))))))
(symbol-macrolet ((lang-entry (getf *translations* language)))
(unless lang-entry
(warn "Implicitly creating language ~A." language)
(define-language language))
(format t "[~a] ~a -> ~a~%" language phrase translation)
(setf (gethash phrase dict) translation)))
(setf (second lang-entry) (remove phrase
(second lang-entry)
:test #'equal
:count 1)
(gethash phrase (first lang-entry)) translation)))
(defun add-translations (language &rest translations)
"Add any number of TRANSLATIONS for the given LANGUAGE"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment