aboutsummaryrefslogtreecommitdiff
path: root/module/datetime
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-07 22:12:29 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-07 22:12:29 +0200
commite377df7b305514d721510fe1f15921647ebc7552 (patch)
tree35dd17aaf5e29c44c0f13401b6cb86e4d7df5acd /module/datetime
parentRename filename-extension{ => ?}. (diff)
parentFix translation for (vcomponent datetime output). (diff)
downloadcalp-e377df7b305514d721510fe1f15921647ebc7552.tar.gz
calp-e377df7b305514d721510fe1f15921647ebc7552.tar.xz
Merge branch 'translation'
Diffstat (limited to 'module/datetime')
-rw-r--r--module/datetime/instance.scm5
-rw-r--r--module/datetime/timespec.scm3
-rw-r--r--module/datetime/zic.scm21
3 files changed, 18 insertions, 11 deletions
diff --git a/module/datetime/instance.scm b/module/datetime/instance.scm
index 5ce312f2..2b060204 100644
--- a/module/datetime/instance.scm
+++ b/module/datetime/instance.scm
@@ -5,10 +5,11 @@
:use-module ((hnh util path) :select (path-append))
:use-module (datetime zic)
:use-module ((xdg basedir) :prefix xdg-)
+ :use-module (calp translation)
:export (zoneinfo))
(define-config tz-list '()
- description: "List of default zoneinfo files to be parsed")
+ description: (_ "List of default zoneinfo files to be parsed"))
;; TODO see (vcomponent uil instance), this has a similar problem with early load
;; Takes a list of zoneinfo files relative
@@ -24,7 +25,7 @@
(()
(define tz-list (get-config 'tz-list))
(if (null? tz-list)
- (warning "Default zoneinfo only available when tz-dir and tz-list are configured")
+ (warning (_ "Default zoneinfo only available when tz-dir and tz-list are configured"))
(self tz-list)))
((file-list)
(provide 'zoneinfo)
diff --git a/module/datetime/timespec.scm b/module/datetime/timespec.scm
index d3a84671..099634b6 100644
--- a/module/datetime/timespec.scm
+++ b/module/datetime/timespec.scm
@@ -11,6 +11,7 @@
:use-module (datetime)
:use-module (srfi srfi-1)
:use-module (srfi srfi-9 gnu)
+ :use-module (calp translation)
)
@@ -33,7 +34,7 @@
(define-public (timespec-add . specs)
(unless (apply eqv? (map timespec-type specs))
- (warning "Adding timespecs of differing types"))
+ (warning (_ "Adding timespecs of differing types")))
(reduce (lambda (spec done)
(cond
diff --git a/module/datetime/zic.scm b/module/datetime/zic.scm
index b0630f3e..e2600d4f 100644
--- a/module/datetime/zic.scm
+++ b/module/datetime/zic.scm
@@ -22,6 +22,7 @@
:use-module (srfi srfi-9 gnu)
:use-module ((vcomponent recurrence internal)
:select (byday make-recur-rule bymonthday))
+ :use-module (calp translation)
)
@@ -166,7 +167,7 @@
day: (string->number day))
time: (timespec-time timespec)
tz: (case (timespec-type timespec)
- [(#\s) (warning "what even is \"Standard time\"‽") ""]
+ [(#\s) (warning (_ "what even is \"Standard time\"‽")) ""]
[(#\w) #f]
;; Since we might represent times before UTC existed
;; this is a bit of a lie. But it should work.
@@ -263,7 +264,7 @@
;; They were removed since they were unused, uneeded, and was
;; technical dept.
(scm-error 'misc-error "parse-zic-file"
- "Invalid key ~s. Note that leap seconds and expries rules aren't yet implemented."
+ (_ "Invalid key ~s. Note that leap seconds and expries rules aren't yet implemented.")
(list type)
#f)]
))]))))))
@@ -301,7 +302,7 @@
(target (link-target link))
(target-item (hash-ref zones target #f)))
(if (not target-item)
- (warning "Unresolved link, target missing ~a -> ~a" name target)
+ (warning (_ "Unresolved link, target missing ~a -> ~a") name target)
(hash-set! zones name target-item))))
(car it)))
@@ -341,7 +342,7 @@
(set (day d) base-day)))]))
tz: (case (timespec-type (rule-at rule))
((#\w) #f)
- ((#\s) (warning "what even is \"Standard time\"‽") #f)
+ ((#\s) (warning (_ "what even is \"Standard time\"‽")) #f)
((#\u #\g #\z) 'UTC))))
(let ((timespec (rule-at rule)))
@@ -363,7 +364,7 @@
(case to
((maximum) #f)
((minimum) (scm-error 'misc-error "rule->rrule"
- "Check your input"
+ (_ "Check your input")
#f #f))
((only)
(datetime
@@ -388,7 +389,7 @@
;; Sun>=8
(let* (((<> wday base-day) (rule-on rule)))
(when (eq? '< <>)
- (warning "Counting backward for RRULES unsupported"))
+ (warning (_ "Counting backward for RRULES unsupported")))
;; NOTE this only realy works when base-day = 7n + 1, n ∈ N
;; something like Sun>=5 is hard to fix, since we can only
;; say which sunday in the month we want (first sunday,
@@ -406,11 +407,15 @@
idx (+ idx 2))]
[(#\z)
;; NOTE No zones seem to currently use %z formatting.
- (warning "%z not yet implemented")
+ ;; '%z' is NOT a format string, but information about another format string.
+ (warning (_ "%z not yet implemented"))
fmt-string]
[else (scm-error 'misc-error "zone-format"
- "Invalid format char ~s in ~s at position ~a"
+ ;; first slot is the errornous character,
+ ;; second is the whole string, third is the index
+ ;; of the faulty character.
+ (_ "Invalid format char ~s in ~s at position ~a")
(list (string-index fmt-string (1+ idx))
fmt-string
(1+ idx))