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: Daniel Kochmański's avatarDaniel Kochmański <>
parent 86f73c60
......@@ -36,13 +36,16 @@ corresponding objects."
If LANGUAGE doesn't exist, it is implicitly created and a warning is
(check-type phrase string)
(let ((dict (car (or (getf *translations* language)
(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"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment