[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
168/197: installer: Fix the startup locale.
From: |
Danny Milosavljevic |
Subject: |
168/197: installer: Fix the startup locale. |
Date: |
Mon, 3 Jul 2017 20:37:19 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 6a1c827acc61e9d268eb7fd3af9ea793d4214dae
Author: John Darrington <address@hidden>
Date: Sun Feb 5 16:50:47 2017 +0100
installer: Fix the startup locale.
* gnu/system/installer/guixsd-installer.scm (guixsd-installer): Don't
try to restore the locale after initialisation.
---
gnu/system/installer/guixsd-installer.scm | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index 4f2e92b..0d48f1e 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -44,7 +44,7 @@
(ice-9 format)
(ice-9 match)
- (ice-9 pretty-print)
+ (ice-9 i18n)
(srfi srfi-1)
(srfi srfi-9))
@@ -287,17 +287,13 @@ tail of the list."
(lambda ()
(define stdscr
- ((lambda ()
- ;; initscr must be called whilst the UTF-8 encoding is in the
locale.
- ;; Otherwise, on certain terminal types, bad things will happen when
- ;; one later changes to UTF-8.
- (define old-locale #f)
- (dynamic-wind
- (lambda ()
- (set! old-locale (setlocale LC_ALL))
- (setlocale LC_ALL "en_US.UTF-8"))
- (lambda () (initscr)) ;; Initialise ncurses
- (lambda () (setlocale LC_ALL old-locale))))))
+ ;; initscr must be called whilst the UTF-8 encoding is in the locale.
+ ;; Otherwise, on certain terminal types, bad things will happen when
+ ;; one later changes to UTF-8.
+ (let ((enc (locale-encoding)))
+ (when (not (equal? enc "UTF-8"))
+ (setlocale LC_ALL "en_US.utf8"))
+ (initscr)))
;; We don't want any nasty kernel messages damaging our beautifully
;; crafted display.
@@ -317,7 +313,6 @@ tail of the list."
(let ((page (make-page
stdscr (gettext "GuixSD Installer")
main-page-refresh 0 main-page-key-handler)))
-
(page-enter page)
(let loop ((ch (getch stdscr)))
(let ((current-page (car page-stack)))
- 129/197: installer: Emphasise that writing filesystems destroys existing data., (continued)
- 129/197: installer: Emphasise that writing filesystems destroys existing data., Danny Milosavljevic, 2017/07/03
- 150/197: gurses: Reimplement pad-complex-string., Danny Milosavljevic, 2017/07/03
- 159/197: installer: Fix i18n in dialogs., Danny Milosavljevic, 2017/07/03
- 154/197: installer: Main page: Redisplay translatable strings upon refresh., Danny Milosavljevic, 2017/07/03
- 157/197: installer: Replace 'file-browser' with 'key-map'., Danny Milosavljevic, 2017/07/03
- 161/197: installer: Improve i18n in ping page., Danny Milosavljevic, 2017/07/03
- 162/197: gurses: Avoid one use of car/cdr., Danny Milosavljevic, 2017/07/03
- 166/197: installer: Provide verbose description of locale., Danny Milosavljevic, 2017/07/03
- 167/197: installer: Fix bug when changing languages., Danny Milosavljevic, 2017/07/03
- 156/197: installer: New page to select language., Danny Milosavljevic, 2017/07/03
- 168/197: installer: Fix the startup locale.,
Danny Milosavljevic <=
- 173/197: installer: Remove whitespace., Danny Milosavljevic, 2017/07/03
- 01/197: gnu: Add graphical installer, Danny Milosavljevic, 2017/07/03
- 174/197: installer: Provide the ability to add new users., Danny Milosavljevic, 2017/07/03
- 178/197: installer: Infer likely entries for user accounts from the gecos field., Danny Milosavljevic, 2017/07/03
- 180/197: installer: Use a different mount-point for each install attempt., Danny Milosavljevic, 2017/07/03
- 183/197: installer: Specify a pid file for wpa_supplicant., Danny Milosavljevic, 2017/07/03
- 181/197: installer: Make the install attempts counter global., Danny Milosavljevic, 2017/07/03
- 186/197: installer: Return to network page after passphrase entry., Danny Milosavljevic, 2017/07/03
- 185/197: installer: Avoid flicker in network page., Danny Milosavljevic, 2017/07/03
- 169/197: installer: Add users page., Danny Milosavljevic, 2017/07/03