aboutsummaryrefslogtreecommitdiff
path: root/tests/test/translation.scm
blob: 5fb32ab0aac9b278b5c343694224911e8135fa4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(define-module (test translation)
  :use-module (srfi srfi-64)
  :use-module (srfi srfi-88)
  :use-module (calp translation)
  :use-module (ice-9 i18n))

(define sv (make-locale (list LC_CTYPE LC_MESSAGES) "sv_SE.UTF-8"))

;; empty key should give us translation header
;; this also tests that translations are properly loaded
(test-assert "translations" (string? (translate "")))

(test-equal "yes-no yes" 'yes (yes-no-check "y" sv))
(test-equal "yes-no no" 'no (yes-no-check "n" sv))
(test-equal "yes-no invalid" #f (yes-no-check "other" sv))