Add tests to find-l10n
This commit is contained in:
parent
b6c9bff81c
commit
f141d92aa1
1 changed files with 6 additions and 9 deletions
|
@ -66,15 +66,12 @@
|
||||||
"Localization (l10n) settings for multi-language support.")
|
"Localization (l10n) settings for multi-language support.")
|
||||||
|
|
||||||
(defun find-l10n (key lang alist)
|
(defun find-l10n (key lang alist)
|
||||||
"Finds the localized string for a given key and language.
|
"Finds the localized string for a given key and language."
|
||||||
|
(let ((entry (cadr (assoc key alist :test #'string=))))
|
||||||
KEY: The key to look up the localization for.
|
(if entry
|
||||||
|
(let ((term (cadr (member lang entry :test #'string=))))
|
||||||
LANG: The language to get the localized string for."
|
(or term "Translation not found"))
|
||||||
(let ((term (cadr (assoc key alist :test #'string=))))
|
"Key not found")))
|
||||||
(if term
|
|
||||||
(cadr (member lang term :test #'string=))
|
|
||||||
"Translation not found")))
|
|
||||||
|
|
||||||
(defmacro with-page ((&key (author "") (description "") (cdn t) (pagetitle "") (theme "dark")) &body body)
|
(defmacro with-page ((&key (author "") (description "") (cdn t) (pagetitle "") (theme "dark")) &body body)
|
||||||
`(spinneret:with-html
|
`(spinneret:with-html
|
||||||
|
|
Loading…
Add table
Reference in a new issue