Move find-l10n function
This commit is contained in:
parent
d6e26417bc
commit
b6c9bff81c
1 changed files with 11 additions and 11 deletions
|
@ -65,6 +65,17 @@
|
||||||
("learn-more" ("en" "Learn More" "de" "Mehr erfahren" "fr" "En savoir plus")))
|
("learn-more" ("en" "Learn More" "de" "Mehr erfahren" "fr" "En savoir plus")))
|
||||||
"Localization (l10n) settings for multi-language support.")
|
"Localization (l10n) settings for multi-language support.")
|
||||||
|
|
||||||
|
(defun find-l10n (key lang alist)
|
||||||
|
"Finds the localized string for a given key and language.
|
||||||
|
|
||||||
|
KEY: The key to look up the localization for.
|
||||||
|
|
||||||
|
LANG: The language to get the localized string for."
|
||||||
|
(let ((term (cadr (assoc key alist :test #'string=))))
|
||||||
|
(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
|
||||||
(:doctype)
|
(:doctype)
|
||||||
|
@ -90,14 +101,3 @@
|
||||||
(spinneret:*fill-column* fc))
|
(spinneret:*fill-column* fc))
|
||||||
(with-open-file (stream filename :direction :output :if-exists :supersede)
|
(with-open-file (stream filename :direction :output :if-exists :supersede)
|
||||||
(write-string string stream))))
|
(write-string string stream))))
|
||||||
|
|
||||||
(defun find-l10n (key lang alist)
|
|
||||||
"Finds the localized string for a given key and language.
|
|
||||||
|
|
||||||
KEY: The key to look up the localization for.
|
|
||||||
|
|
||||||
LANG: The language to get the localized string for."
|
|
||||||
(let ((term (cadr (assoc key alist :test #'string=))))
|
|
||||||
(if term
|
|
||||||
(cadr (member lang term :test #'string=))
|
|
||||||
"Translation not found")))
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue