summaryrefslogtreecommitdiff
path: root/guix/ui.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-09-06 15:47:06 +0200
committerLudovic Courtès <ludo@gnu.org>2015-09-06 15:52:04 +0200
commita5c0d8bc557affbcb58a4d2cb0059604e0cb89fa (patch)
tree84eb5216dbe2a7577cd15af7136e52ef72275e2a /guix/ui.scm
parent37ab3abad35839b231074ea953f3287d395ac970 (diff)
downloadgnu-guix-a5c0d8bc557affbcb58a4d2cb0059604e0cb89fa.tar
gnu-guix-a5c0d8bc557affbcb58a4d2cb0059604e0cb89fa.tar.gz
ui: Change 'P_' to return the empty string when passed the empty string.
Reported by Mathieu Lirzin <mathieu.lirzin@etu.u-bordeaux.fr> at <https://lists.gnu.org/archive/html/guix-devel/2015-09/msg00111.html>. * guix/ui.scm (P_): Check whether MSGID is empty, and return it if it is.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r--guix/ui.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 8de8e3c863..2f757547cf 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -99,7 +99,15 @@
(define _ (cut gettext <> %gettext-domain))
(define N_ (cut ngettext <> <> <> %gettext-domain))
-(define P_ (cut gettext <> %package-text-domain))
+
+(define (P_ msgid)
+ "Return the translation of the package description or synopsis MSGID."
+ ;; Descriptions/synopses might occasionally be empty strings, even if that
+ ;; is something we try to avoid. Since (gettext "") can return a non-empty
+ ;; string, explicitly check for that case.
+ (if (string-null? msgid)
+ msgid
+ (gettext msgid %package-text-domain)))
(define-syntax-rule (define-diagnostic name prefix)
"Create a diagnostic macro (i.e., NAME), which will prepend PREFIX to all