guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 02/07: 'report-error' now translates messages.


From: Ludovic Courtès
Subject: [shepherd] 02/07: 'report-error' now translates messages.
Date: Thu, 18 Apr 2019 06:25:27 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit cadda80c2484740b57cbba9e19268d71f39c3016
Author: Ludovic Courtès <address@hidden>
Date:   Thu Apr 18 11:06:32 2019 +0200

    'report-error' now translates messages.
    
    Until now, messages passed to 'report-error' would never be passed to
    gettext.
    
    * modules/shepherd/support.scm (report-error): Guard now checks that P
    is actually L10N.  Add call to 'l10n' on MESSAGE and remove
    expansion-time format string modification.
---
 modules/shepherd/support.scm | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/shepherd/support.scm b/modules/shepherd/support.scm
index 02d8c84..0de3fe6 100644
--- a/modules/shepherd/support.scm
+++ b/modules/shepherd/support.scm
@@ -252,12 +252,11 @@ There is NO WARRANTY, to the extent permitted by law.")))
     "Report the given error message to stderr in standard GNU error format."
     (syntax-case s ()
       ((_ (p message) args ...)
-       (string? (syntax->datum #'message))
+       (and (free-identifier=? #'p #'l10n)
+            (string? (syntax->datum #'message)))
 
-       (with-syntax ((message (string-append
-                               "~a: " (syntax->datum #'message) "~%")))
-         #'(format (current-error-port) message
-                   (program-name) args ...))))))
+       #'(format (current-error-port) "~a: ~a~%" (program-name)
+                 (format #f (l10n message) args ...))))))
 
 (define* (display-line message #:optional (port (current-output-port)))
   "Display MESSAGE followed by a newline to PORT."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]