summaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-06-13 17:30:40 +0200
committerLudovic Courtès <ludo@gnu.org>2014-06-13 17:30:40 +0200
commitee76417972b3a749a28a627c2858c09311d9c0c5 (patch)
treeb47f7f0959763d3b445bf5dbd11025c2e4480b1f /guix/ui.scm
parentef1a9bb7d6fd64f05607042fdb266ee974d16e26 (diff)
Separate package description translations from string translations.
* po/packages/LINGUAS, po/packages/Makevars, po/packages/POTFILES.in: New files. * po/guix/Makevars (DOMAIN): Change to "guix". (XGETTEXT_OPTIONS): Remove "--keyword=synopsis --keyword=description". * po/guix/POTFILES.in: Remove gnu/packages/*.scm. * configure.ac: Change to gettext 0.18.3. Produce po/packages/Makefile.in. * Makefile.am (SUBDIRS): Add po/packages. * guix/ui.scm (%package-text-domain): New variable. (P_): New procedure. (package->recutils): Use 'P_' instead of '_'. * guix/scripts/package.scm (find-packages-by-description): Use 'P_' instead of 'gettext'.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 48b5c745c6..6fef9b36e4 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -39,6 +39,7 @@
#:use-module (ice-9 regex)
#:export (_
N_
+ P_
leave
show-version-and-exit
show-bug-report-information
@@ -72,10 +73,16 @@
;;; Code:
(define %gettext-domain
+ ;; Text domain for strings used in the tools.
"guix")
+(define %package-text-domain
+ ;; Text domain for package synopses and descriptions.
+ "guix-packages")
+
(define _ (cut gettext <> %gettext-domain))
(define N_ (cut ngettext <> <> <> %gettext-domain))
+(define P_ (cut gettext <> %package-text-domain))
(define-syntax-rule (define-diagnostic name prefix)
"Create a diagnostic macro (i.e., NAME), which will prepend PREFIX to all
@@ -431,7 +438,7 @@ followed by \"+ \", which makes for a valid multi-line field value in the
"Write to PORT a `recutils' record of package P, arranging to fit within
WIDTH columns."
(define (description->recutils str)
- (let ((str (_ str)))
+ (let ((str (P_ str)))
(string->recutils
(fill-paragraph str width
(string-length "description: ")))))
@@ -460,7 +467,7 @@ WIDTH columns."
(string-map (match-lambda
(#\newline #\space)
(chr chr))
- (or (and=> (package-synopsis p) _)
+ (or (and=> (package-synopsis p) P_)
"")))
(format port "description: ~a~%"
(and=> (package-description p) description->recutils))