[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18/18: installer: Fix bug when changing languages.
From: |
John Darrington |
Subject: |
18/18: installer: Fix bug when changing languages. |
Date: |
Thu, 2 Feb 2017 18:13:05 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 688f4f752fad5bea1afacaa3ddfcfdb0fcd2f861
Author: John Darrington <address@hidden>
Date: Thu Feb 2 12:55:18 2017 +0100
installer: Fix bug when changing languages.
* gnu/system/installer/guixsd-installer.scm (guixsd-installer): Set
locale to a utf8 based locale before initialising ncurses.
---
gnu/system/installer/guixsd-installer.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index c84e099..4f2e92b 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -286,7 +286,18 @@ tail of the list."
(catch #t
(lambda ()
- (define stdscr (initscr)) ; Start curses
+ (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))))))
;; We don't want any nasty kernel messages damaging our beautifully
;; crafted display.
- branch wip-installer updated (9ff399e -> 688f4f7), John Darrington, 2017/02/02
- 04/18: installer: Add optional arguments to addstr*., John Darrington, 2017/02/02
- 02/18: installer: New gettext keyword M_., John Darrington, 2017/02/02
- 01/18: installer: Avoid wpa_supplicant's output causing screen damage., John Darrington, 2017/02/02
- 05/18: installer: Main page: Redisplay translatable strings upon refresh., John Darrington, 2017/02/02
- 09/18: installer: Correct placement of gettext call., John Darrington, 2017/02/02
- 08/18: installer: Replace 'file-browser' with 'key-map'., John Darrington, 2017/02/02
- 06/18: installer: Use _ instead of M_ for host-name-refresh., John Darrington, 2017/02/02
- 14/18: gurses: Cache the windows of buttons., John Darrington, 2017/02/02
- 16/18: installer: New procedure key-value-slurp., John Darrington, 2017/02/02
- 18/18: installer: Fix bug when changing languages.,
John Darrington <=
- 07/18: installer: New page to select language., John Darrington, 2017/02/02
- 10/18: installer: Fix i18n in dialogs., John Darrington, 2017/02/02
- 17/18: installer: Provide verbose description of locale., John Darrington, 2017/02/02
- 03/18: installer: New file i18n.scm., John Darrington, 2017/02/02
- 11/18: installer: New convenience procedures., John Darrington, 2017/02/02
- 13/18: gurses: Avoid one use of car/cdr., John Darrington, 2017/02/02
- 15/18: gurses: Use match instead of car., John Darrington, 2017/02/02
- 12/18: installer: Improve i18n in ping page., John Darrington, 2017/02/02