diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-04-12 17:13:26 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-04-12 17:56:23 +0200 |
commit | c7dc604253631588c659c1022256af98ec9262af (patch) | |
tree | dc20b5022928f4e3f59405696315952444821b64 /gnu/installer.scm | |
parent | 126d4c12ce18a35a0d971778133f05b7c6ad81b3 (diff) | |
download | guix-c7dc604253631588c659c1022256af98ec9262af.tar.gz |
installer: Choosing a locale opens the translated manual on tty2.
Suggested by Florian Pelz. * gnu/system/install.scm (%installation-node-names): New variable. (log-to-info): Expect the chosen locale as an argument. Compute the language, Info file name, and node name. Install the locale. (documentation-shepherd-service): Add 'locale' parameter to the 'start' action and honor it. Set GUIX_LOCPATH and TERM as environment variables for the process. * gnu/installer.scm (apply-locale): Use (gnu services herd). Call 'stop-service' and 'start-service' with the chosen locale.
Diffstat (limited to 'gnu/installer.scm')
-rw-r--r-- | gnu/installer.scm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm index 50e2e7d85e..6a7a556271 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -91,9 +91,17 @@ version of this file." (define apply-locale ;; Install the specified locale. - #~(lambda (locale-name) - (false-if-exception - (setlocale LC_ALL locale-name)))) + (with-imported-modules (source-module-closure '((gnu services herd))) + #~(lambda (locale) + (false-if-exception + (setlocale LC_ALL locale)) + + ;; Restart the documentation viewer so it displays the manual in + ;; language that corresponds to LOCALE. + (with-error-to-port (%make-void-port "w") + (lambda () + (stop-service 'term-tty2) + (start-service 'term-tty2 (list locale))))))) (define* (compute-locale-step #:key locales-name @@ -323,6 +331,7 @@ selected keymap." (gnu installer newt) ((gnu installer newt keymap) #:select (keyboard-layout->configuration)) + (gnu services herd) (guix i18n) (guix build utils) (ice-9 match)) |