mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
installer: Run 'guix system init' with the right locale.
* gnu/installer/utils.scm (run-shell-command): Add #:locale and honor it. * gnu/installer/newt/final.scm (run-install-shell): Add 'locale' parameter; pass it to 'install-system'. (run-final-page): Obtain locale from RESULT; pass it to 'run-install-shell'. * gnu/installer/final.scm (install-system): Add 'locale' parameter; pass it to 'run-shell-command'.
This commit is contained in:
parent
5582aa8e31
commit
7611074f67
3 changed files with 23 additions and 8 deletions
|
@ -54,9 +54,21 @@ number. If no percentage is found, return #f"
|
|||
(and result
|
||||
(string->number (match:substring result 1)))))
|
||||
|
||||
(define (run-shell-command command)
|
||||
(define* (run-shell-command command #:key locale)
|
||||
"Run COMMAND, a string, with Bash, and in the given LOCALE."
|
||||
(call-with-temporary-output-file
|
||||
(lambda (file port)
|
||||
(when locale
|
||||
(let ((supported? (false-if-exception
|
||||
(setlocale LC_ALL locale))))
|
||||
;; If LOCALE is not supported, then set LANGUAGE, which might at
|
||||
;; least give us translated messages.
|
||||
(if supported?
|
||||
(format port "export LC_ALL=\"~a\"~%" locale)
|
||||
(format port "export LANGUAGE=\"~a\"~%"
|
||||
(string-take locale
|
||||
(string-index locale #\_))))))
|
||||
|
||||
(format port "~a~%" command)
|
||||
;; (format port "exit~%")
|
||||
(close port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue