diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index e0a694ad0f6404e4c4f4756c0f67a89e0dd809f8..fa1dd09df8a6d607cbaf2c4bbd7196afde741c68 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -1000,6 +1000,13 @@ (define (guix-substitute . args) (newline) (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-error-handling ; for signature errors (match args diff --git a/guix/store.scm b/guix/store.scm index af311a0ebdfd9c67b4538dc090e006bf4fbada94..8d1099dab20c31da792dd84e70cfa0e40b9d0d30 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -534,7 +534,10 @@ (define* (set-build-options server (substitute-urls #f) ;; 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'. (define socket @@ -573,6 +576,9 @@ (define socket ,@(if terminal-columns `(("terminal-columns" . ,(number->string terminal-columns))) + '()) + ,@(if locale + `(("locale" . ,locale)) '())))) (send (string-pairs pairs)))) (let loop ((done? (process-stderr server)))