[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
17/18: installer: Provide verbose description of locale.
From: |
John Darrington |
Subject: |
17/18: installer: Provide verbose description of locale. |
Date: |
Thu, 2 Feb 2017 18:13:05 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 10418a2e1a1cd299db714d00afd76b54a0364f48
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)
- 01/18: installer: Avoid wpa_supplicant's output causing screen damage., (continued)
- 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, 2017/02/02
- 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 <=
- 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