[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/11: installer: Use the normalized codeset in the 'locale' field.
From: |
guix-commits |
Subject: |
05/11: installer: Use the normalized codeset in the 'locale' field. |
Date: |
Sun, 7 Apr 2019 12:06:14 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit cbd01cff797750e38b1c3061761d41398b53c86b
Author: Ludovic Courtès <address@hidden>
Date: Sun Apr 7 16:19:09 2019 +0200
installer: Use the normalized codeset in the 'locale' field.
* gnu/installer/locale.scm (normalize-codeset): New procedure.
(locale->locale-string): Use it.
---
gnu/installer/locale.scm | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/gnu/installer/locale.scm b/gnu/installer/locale.scm
index 2b45b22..284062a 100644
--- a/gnu/installer/locale.scm
+++ b/gnu/installer/locale.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <address@hidden>
+;;; Copyright © 2019 Ludovic Courtès <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -69,6 +70,24 @@
(codeset . ,(match:substring matches 5))
(modifier . ,(match:substring matches 7)))))
+(define (normalize-codeset codeset)
+ "Compute the \"normalized\" variant of CODESET."
+ ;; info "(libc) Using gettextized software", for the algorithm used to
+ ;; compute the normalized codeset.
+ (letrec-syntax ((-> (syntax-rules ()
+ ((_ proc value)
+ (proc value))
+ ((_ proc rest ...)
+ (proc (-> rest ...))))))
+ (-> (lambda (str)
+ (if (string-every char-set:digit str)
+ (string-append "iso" str)
+ str))
+ string-downcase
+ (lambda (str)
+ (string-filter char-set:letter+digit str))
+ codeset)))
+
(define (locale->locale-string locale)
"Reverse operation of locale-string->locale."
(let ((language (locale-language locale))
@@ -81,7 +100,7 @@
`("_" ,territory)
'())
,@(if codeset
- `("." ,codeset)
+ `("." ,(normalize-codeset codeset))
'())
,@(if modifier
`("@" ,modifier)
- branch master updated (32c055f -> 71b4974), guix-commits, 2019/04/07
- 01/11: size: Optimize dependency size computation., guix-commits, 2019/04/07
- 03/11: installer: Simplify locale dialogs., guix-commits, 2019/04/07
- 07/11: installer: Remove SLiM-specific instructions., guix-commits, 2019/04/07
- 02/11: doc: Fix syntax of cross-manual references., guix-commits, 2019/04/07
- 05/11: installer: Use the normalized codeset in the 'locale' field.,
guix-commits <=
- 06/11: installer: Fix wording for "Internet access.", guix-commits, 2019/04/07
- 08/11: installer: Generalize desktop environments to system services., guix-commits, 2019/04/07
- 11/11: gnu: address@hidden: Move to ssh.scm., guix-commits, 2019/04/07
- 10/11: services: dropbear: Add default value., guix-commits, 2019/04/07
- 04/11: installer: Move the 'locale' step before the 'welcome' step., guix-commits, 2019/04/07
- 09/11: installer: Add dialog to select networking services., guix-commits, 2019/04/07