diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-07 22:12:29 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-04-07 22:12:29 +0200 |
commit | e377df7b305514d721510fe1f15921647ebc7552 (patch) | |
tree | 35dd17aaf5e29c44c0f13401b6cb86e4d7df5acd /module/vcomponent/util | |
parent | Rename filename-extension{ => ?}. (diff) | |
parent | Fix translation for (vcomponent datetime output). (diff) | |
download | calp-e377df7b305514d721510fe1f15921647ebc7552.tar.gz calp-e377df7b305514d721510fe1f15921647ebc7552.tar.xz |
Merge branch 'translation'
Diffstat (limited to 'module/vcomponent/util')
-rw-r--r-- | module/vcomponent/util/instance.scm | 3 | ||||
-rw-r--r-- | module/vcomponent/util/instance/methods.scm | 14 | ||||
-rw-r--r-- | module/vcomponent/util/parse-cal-path.scm | 5 |
3 files changed, 13 insertions, 9 deletions
diff --git a/module/vcomponent/util/instance.scm b/module/vcomponent/util/instance.scm index 6e1e765f..d17b672a 100644 --- a/module/vcomponent/util/instance.scm +++ b/module/vcomponent/util/instance.scm @@ -2,6 +2,7 @@ :use-module (hnh util) :use-module ((calp util config) :select (get-config)) :use-module ((oop goops) :select (make)) + :use-module (calp translation) :export (global-event-object) ) @@ -18,5 +19,5 @@ (define-public (reload) (let ((new-value (make (@@ (vcomponent util instance methods) <events>) calendar-files: (get-config 'calendar-files)))) - (display "Reload done\n" (current-error-port)) + (format (current-error-port) (_ "Reload done~%")) (set! global-event-object new-value))) diff --git a/module/vcomponent/util/instance/methods.scm b/module/vcomponent/util/instance/methods.scm index 1edad44b..57d12f6b 100644 --- a/module/vcomponent/util/instance/methods.scm +++ b/module/vcomponent/util/instance/methods.scm @@ -12,6 +12,8 @@ :use-module ((vcomponent datetime) :select (ev-time<?)) :use-module (oop goops) + :use-module (calp translation) + :export (add-event remove-event @@ -70,7 +72,7 @@ (define-method (initialize (this <events>) args) (next-method) - (format (current-error-port) "Building <events> from~%") + (format (current-error-port) (_ "Building <events> from~%")) (for calendar in (slot-ref this 'calendar-files) (format (current-error-port) " - ~a~%" calendar)) @@ -185,13 +187,13 @@ ;; save-event sets -X-HNH-FILENAME from the UID. This is fine ;; since the two events are guaranteed to have the same UID. (unless ((@ (vcomponent formats vdir save-delete) save-event) event) - (throw 'misc-error "Saving event to disk failed.")) + (throw 'misc-error (_ "Saving event to disk failed."))) (unless (eq? calendar (parent old-event)) ;; change to a new calendar (format (current-error-port) - "Unlinking old event from ~a~%" + (_ "Unlinking old event from ~a~%") (prop old-event '-X-HNH-FILENAME)) ;; NOTE that this may fail, leading to a duplicate event being ;; created (since we save beforehand). This is just a minor problem @@ -201,7 +203,7 @@ (format (current-error-port) - "Event updated ~a~%" (prop event 'UID)))] + (_ "Event updated ~a~%") (prop event 'UID)))] [else (add-event this calendar event) @@ -211,7 +213,7 @@ ;; NOTE Posibly defer save to a later point. ;; That would allow better asyncronous preformance. (unless ((@ (vcomponent formats vdir save-delete) save-event) event) - (throw 'misc-error "Saving event to disk failed.")) + (throw 'misc-error (_ "Saving event to disk failed."))) (format (current-error-port) - "Event inserted ~a~%" (prop event 'UID))])) + (_ "Event inserted ~a~%") (prop event 'UID))])) diff --git a/module/vcomponent/util/parse-cal-path.scm b/module/vcomponent/util/parse-cal-path.scm index df3fbf75..4baa647e 100644 --- a/module/vcomponent/util/parse-cal-path.scm +++ b/module/vcomponent/util/parse-cal-path.scm @@ -2,6 +2,7 @@ :use-module (hnh util) :use-module ((calp util time) :select (report-time!)) :use-module (vcomponent base) + :use-module (calp translation) :use-module ((vcomponent formats ical parse) :select (parse-calendar)) :use-module ((vcomponent formats vdir parse) @@ -19,14 +20,14 @@ (set! (prop comp '-X-HNH-SOURCETYPE) 'file) comp) ] [(directory) - (report-time! "Parsing ~a" path) + (report-time! (_ "Parsing ~a") path) (let ((comp (parse-vdir path))) (set! (prop comp '-X-HNH-SOURCETYPE) 'vdir (prop comp '-X-HNH-DIRECTORY) path) comp)] [(block-special char-special fifo socket unknown symlink) => (lambda (t) (scm-error 'misc-error "parse-cal-path" - "Can't parse file of type ~s" + (_ "Can't parse file of type ~s") (list t) #f))])) |