From ee76417972b3a749a28a627c2858c09311d9c0c5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 13 Jun 2014 17:30:40 +0200 Subject: 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'. --- guix/scripts/package.scm | 6 +++--- guix/ui.scm | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'guix') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 3947159c2e..f930b00804 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -228,11 +228,11 @@ RX." (define matches? (cut regexp-exec rx <>)) - (if (or (matches? (gettext (package-name package))) + (if (or (matches? (package-name package)) (and=> (package-synopsis package) - (compose matches? gettext)) + (compose matches? P_)) (and=> (package-description package) - (compose matches? gettext))) + (compose matches? P_))) (cons package result) result)) '()) 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)) -- cgit v1.2.3