Skip to content
Snippets Groups Projects
Commit 38f50f49 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

substitute: Install the client's locale.

* guix/store.scm (set-build-options): Add #:locale parameter and honor
it.
* guix/scripts/substitute.scm (guix-substitute): Install the client's
locale.
parent f954c9b5
No related branches found
No related tags found
No related merge requests found
...@@ -1000,6 +1000,13 @@ (define (guix-substitute . args) ...@@ -1000,6 +1000,13 @@ (define (guix-substitute . args)
(newline) (newline)
(force-output (current-output-port)) (force-output (current-output-port))
;; Attempt to install the client's locale, mostly so that messages are
;; suitably translated.
(match (or (find-daemon-option "untrusted-locale")
(find-daemon-option "locale"))
(#f #f)
(locale (false-if-exception (setlocale LC_ALL locale))))
(with-networking (with-networking
(with-error-handling ; for signature errors (with-error-handling ; for signature errors
(match args (match args
......
...@@ -534,7 +534,10 @@ (define* (set-build-options server ...@@ -534,7 +534,10 @@ (define* (set-build-options server
(substitute-urls #f) (substitute-urls #f)
;; Number of columns in the client's terminal. ;; Number of columns in the client's terminal.
(terminal-columns (terminal-columns))) (terminal-columns (terminal-columns))
;; Locale of the client.
(locale (false-if-exception (setlocale LC_ALL))))
;; Must be called after `open-connection'. ;; Must be called after `open-connection'.
(define socket (define socket
...@@ -573,6 +576,9 @@ (define socket ...@@ -573,6 +576,9 @@ (define socket
,@(if terminal-columns ,@(if terminal-columns
`(("terminal-columns" `(("terminal-columns"
. ,(number->string terminal-columns))) . ,(number->string terminal-columns)))
'())
,@(if locale
`(("locale" . ,locale))
'())))) '()))))
(send (string-pairs pairs)))) (send (string-pairs pairs))))
(let loop ((done? (process-stderr server))) (let loop ((done? (process-stderr server)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment