Commit 236cc883 authored by Daniel Kochmański's avatar Daniel Kochmański

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

Little function refactor. Removes added phrase from missing
translations table.
Signed-off-by: 's avatarDaniel Kochmański <daniel@turtleware.eu>
parent 86f73c60
......@@ -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"
......
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