aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/formats/ical
diff options
context:
space:
mode:
Diffstat (limited to 'module/vcomponent/formats/ical')
-rw-r--r--module/vcomponent/formats/ical/output.scm3
-rw-r--r--module/vcomponent/formats/ical/parse.scm29
-rw-r--r--module/vcomponent/formats/ical/types.scm8
3 files changed, 28 insertions, 12 deletions
diff --git a/module/vcomponent/formats/ical/output.scm b/module/vcomponent/formats/ical/output.scm
index fba8bffc..489cdc00 100644
--- a/module/vcomponent/formats/ical/output.scm
+++ b/module/vcomponent/formats/ical/output.scm
@@ -15,6 +15,7 @@
:use-module (vcomponent geo)
:use-module (vcomponent formats ical types)
:use-module (vcomponent recurrence)
+ :use-module (calp translation)
:autoload (vcomponent util instance) (global-event-object)
)
@@ -90,7 +91,7 @@
(get-writer 'TEXT)]
[else
- (warning "Unknown key ~a" key)
+ (warning (_ "Unknown key ~a") key)
(get-writer 'TEXT)]))
(catch #t #; 'wrong-type-arg
diff --git a/module/vcomponent/formats/ical/parse.scm b/module/vcomponent/formats/ical/parse.scm
index 34812a2c..8b6cffeb 100644
--- a/module/vcomponent/formats/ical/parse.scm
+++ b/module/vcomponent/formats/ical/parse.scm
@@ -9,6 +9,7 @@
:use-module (vcomponent base)
:use-module (vcomponent geo)
:use-module (vcomponent formats common types)
+ :use-module (calp translation)
)
(define string->symbol
@@ -120,7 +121,7 @@
(lambda (params value)
(let ((vv (parser params value)))
(when (list? vv)
- (throw 'parse-error "List in enum field"))
+ (throw 'parse-error (_ "List in enum field")))
(let ((v (string->symbol vv)))
(unless (memv v enum)
(warning "~a ∉ { ~{~a~^, ~} }"
@@ -155,7 +156,7 @@
(lambda (params value)
(let ((v ((get-parser 'TEXT) params value)))
(unless (= 1 (length v))
- (warning "List in non-list field: ~s" v))
+ (warning (_ "List in non-list field: ~s") v))
(string-join v ",")))]
;; TEXT, but allow a list
@@ -192,7 +193,7 @@
DRAFT FINAL CANCELED))]
[(memv key '(REQUEST-STATUS))
- (throw 'parse-error "TODO Implement REQUEST-STATUS")]
+ (throw 'parse-error (_ "TODO Implement REQUEST-STATUS"))]
[(memv key '(ACTION))
(enum-parser '(AUDIO DISPLAY EMAIL
@@ -226,7 +227,7 @@
(compose car (get-parser 'TEXT))]
[else
- (warning "Unknown key ~a" key)
+ (warning (_ "Unknown key ~a") key)
(compose car (get-parser 'TEXT))])))
;; If we produced a list create multiple VLINES from it.
@@ -273,9 +274,15 @@
(lambda (fmt . args)
(let ((linedata (get-metadata head*)))
(format
- #f "WARNING parse error around ~a
+ #f
+ ;; arguments:
+ ;; linedata
+ ;; ~?
+ ;; source line
+ ;; source file
+ (_ "WARNING parse error around ~a
~?
- line ~a ~a~%"
+ line ~a ~a~%")
(get-string linedata)
fmt args
(get-line linedata)
@@ -321,10 +328,16 @@
(lambda (err fmt . args)
(let ((linedata (get-metadata head*)))
(display (format
- #f "ERROR parse error around ~a
+ #f
+ ;; arguments
+ ;; linedata
+ ;; ~?
+ ;; source line
+ ;; source file
+ (_ "ERROR parse error around ~a
~?
line ~a ~a
- Defaulting to string~%"
+ Defaulting to string~%")
(get-string linedata)
fmt args
(get-line linedata)
diff --git a/module/vcomponent/formats/ical/types.scm b/module/vcomponent/formats/ical/types.scm
index 39b3b1e3..67f9f633 100644
--- a/module/vcomponent/formats/ical/types.scm
+++ b/module/vcomponent/formats/ical/types.scm
@@ -4,7 +4,9 @@
:use-module (hnh util exceptions)
:use-module (base64)
:use-module (datetime)
- :use-module (datetime timespec))
+ :use-module (datetime timespec)
+ :use-module (calp translation)
+ )
;; TODO shouldn't these really take vline:s?
@@ -35,7 +37,7 @@
;; TODO
(define (write-period _ value)
- (warning "PERIOD writer not yet implemented")
+ (warning (_ "PERIOD writer not yet implemented"))
(with-output-to-string
(lambda () (write value))))
@@ -92,4 +94,4 @@
(define-public (get-writer type)
(or (hashq-ref type-writers type #f)
- (error "No writer for type" type)))
+ (error (_ "No writer for type") type)))