[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
166/197: installer: Provide verbose description of locale.
From: |
Danny Milosavljevic |
Subject: |
166/197: installer: Provide verbose description of locale. |
Date: |
Mon, 3 Jul 2017 20:37:19 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 1bfd783a3565e7ce4086368e0b52f373299ef860
Author: John Darrington <address@hidden>
Date: Thu Feb 2 08:35:42 2017 +0100
installer: Provide verbose description of locale.
* gnu/system/installer/locale.scm (locale-description): New procedure,
and use it in the locale-page-init.
---
gnu/system/installer/locale.scm | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/gnu/system/installer/locale.scm b/gnu/system/installer/locale.scm
index 08de543..4136010 100644
--- a/gnu/system/installer/locale.scm
+++ b/gnu/system/installer/locale.scm
@@ -100,6 +100,26 @@
#f
)
+(define (locale-description locale)
+ "Return a string describing LOCALE"
+ (define loc #f)
+ (define lc-all "LC_ALL")
+ (dynamic-wind
+ (lambda () (set! loc (getenv lc-all))
+ (setenv lc-all locale))
+ (lambda () (let ((str (assq-ref (key-value-slurp
+ (string-append "locale -k LC_IDENTIFICATION"))
+ 'title)))
+ ;; String enclosing "" if they exist
+ (if (and (eqv? (string-ref str 0) #\")
+ (eqv? (string-ref str (1- (string-length str)))
#\"))
+ (substring str 1 (1- (string-length str)))
+ str)))
+ (lambda ()
+ (if loc
+ (setenv lc-all loc)
+ (unsetenv lc-all)))))
+
(define (locale-page-init p)
(let* ((s (page-surface p))
(frame (make-boxed-window #f
@@ -124,7 +144,10 @@
(menu (make-menu %default-locale-definitions
#:disp-proc (lambda (d row)
- (locale-definition-name d)))))
+ (format #f "~60a ~10a"
+ (locale-description
+ (locale-definition-name d))
+ (locale-definition-name d))))))
(push-cursor (page-cursor-visibility p))
(page-set-datum! p 'text-window text-window)
- 140/197: installer: Fix the key map option., (continued)
- 140/197: installer: Fix the key map option., Danny Milosavljevic, 2017/07/03
- 132/197: installer: Add new procedure to check file system specifications., Danny Milosavljevic, 2017/07/03
- 145/197: gurses: Avoid yet another use of car and cdr., Danny Milosavljevic, 2017/07/03
- 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 <=
- 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, 2017/07/03
- 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