aboutsummaryrefslogtreecommitdiff
path: root/module/calp/util/config.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-22 11:19:19 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-22 21:08:41 +0100
commit093ef72e6489d96fb6ffae8d58d7cb1cb7ff77ee (patch)
treed164e37c20e562588700d86379cfda1b0ca3c596 /module/calp/util/config.scm
parentDatetime restrict imports. (diff)
downloadcalp-093ef72e6489d96fb6ffae8d58d7cb1cb7ff77ee.tar.gz
calp-093ef72e6489d96fb6ffae8d58d7cb1cb7ff77ee.tar.xz
Prepare code for translation.
Diffstat (limited to 'module/calp/util/config.scm')
-rw-r--r--module/calp/util/config.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/module/calp/util/config.scm b/module/calp/util/config.scm
index 2fe2b9b0..2637cd85 100644
--- a/module/calp/util/config.scm
+++ b/module/calp/util/config.scm
@@ -9,6 +9,7 @@
:use-module (srfi srfi-1)
:use-module (ice-9 format) ; for format-procedure
:use-module (ice-9 curried-definitions) ; for ensure
+ :use-module (calp translation)
:export (define-config)
)
@@ -38,7 +39,7 @@
(define (define-config% name default-value kwargs)
(for (key value) in (group kwargs 2)
(set! ((or (hashq-ref config-properties key)
- (error "Missing config protperty slot " key))
+ (error (_ "Missing config protperty slot ") key))
name)
value))
(set-config! name (get-config name default-value)))
@@ -53,7 +54,7 @@
(define-public (set-config! name value)
(hashq-set! config-values name
(aif (pre name)
- (or (it value) (error "Pre crashed for" name))
+ (or (it value) (error (_ "Pre crashed for") name))
value))
(awhen (post name) (it value)))
@@ -64,7 +65,7 @@
(if (eq? default %uniq)
(let ((v (hashq-ref config-values key %uniq)))
(when (eq? v %uniq)
- (error "Missing config" key))
+ (error (_ "Missing config") key))
v)
(hashq-ref config-values key default)))
@@ -112,7 +113,7 @@
(hash-map->list list config-values)))
`(*TOP*
- (header "Configuration variables")
+ (header ,(_ "Configuration variables"))
(dl
,@(concatenate
(for (module values) in groups
@@ -124,7 +125,8 @@
`((dt ,key)
(dd (p (@ (inline))
,(or (description key) "")))
- (dt "V:")
+ ;; Configuration variable value indicator
+ (dt ,(_ "V:"))
(dd ,(if (procedure? value)
(format-procedure value)
`(scheme ,value))