[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."
- [shepherd] branch master updated (f260b2f -> 6bb5bdf), Ludovic Courtès, 2019/04/18
- [shepherd] 05/07: support: Update copyright year in '--version' output., Ludovic Courtès, 2019/04/18
- [shepherd] 01/07: herd: Add comment about confusing message., Ludovic Courtès, 2019/04/18
- [shepherd] 07/07: Ignore tests/*.log and tests/*.trs., Ludovic Courtès, 2019/04/18
- [shepherd] 02/07: 'report-error' now translates messages.,
Ludovic Courtès <=
- [shepherd] 03/07: shepherd: Don't fail if the socket file has already been removed., Ludovic Courtès, 2019/04/18
- [shepherd] 04/07: service: Add one-shot services., Ludovic Courtès, 2019/04/18
- [shepherd] 06/07: support: Improve i18n for the '--version' output., Ludovic Courtès, 2019/04/18