[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/10: installer: Sort items with 'string-locale<?'.
From: |
guix-commits |
Subject: |
10/10: installer: Sort items with 'string-locale<?'. |
Date: |
Wed, 17 Apr 2019 05:54:09 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 14755829dc268a3983036908750f4ea40c5224b3
Author: Ludovic Courtès <address@hidden>
Date: Wed Apr 17 11:51:31 2019 +0200
installer: Sort items with 'string-locale<?'.
That way "Österreich" comes before "Schweiz" in a German locale (or
pretty much any sane locale.)
* gnu/installer/newt/page.scm
(run-listbox-selection-page)[sort-listbox-items]:
Use 'string-locale<?' instead of 'string<=?'.
---
gnu/installer/newt/page.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gnu/installer/newt/page.scm b/gnu/installer/newt/page.scm
index 8b3fd48..5c65065 100644
--- a/gnu/installer/newt/page.scm
+++ b/gnu/installer/newt/page.scm
@@ -21,6 +21,7 @@
#:use-module (gnu installer utils)
#:use-module (gnu installer newt utils)
#:use-module (guix i18n)
+ #:use-module (ice-9 i18n)
#:use-module (ice-9 match)
#:use-module (ice-9 receive)
#:use-module (srfi srfi-1)
@@ -223,7 +224,7 @@ be selected (using the <SPACE> key). It that case, a list
containing the
selected items will be returned.
If SORT-LISTBOX-ITEMS? is set to #t, the listbox items are sorted using
-'string<=' procedure (after being converted to text).
+'string-locale<?' procedure (after being converted to text).
If ALLOW-DELETE? is #t, the form will return if the <DELETE> key is pressed,
otherwise nothing will happen.
@@ -249,7 +250,7 @@ ITEM was inserted into LISTBOX."
items))
(define (sort-listbox-items listbox-items)
- "Return LISTBOX-ITEMS sorted using the 'string<=' procedure on the text
+ "Return LISTBOX-ITEMS sorted using the 'string-locale<?' procedure on the
text
corresponding to each item in the list."
(let* ((items (map (lambda (item)
(cons item (listbox-item->text item)))
@@ -258,7 +259,7 @@ corresponding to each item in the list."
(sort items (lambda (a b)
(let ((text-a (cdr a))
(text-b (cdr b)))
- (string<= text-a text-b))))))
+ (string-locale<? text-a text-b))))))
(map car sorted-items)))
;; Store the last selected listbox item's key.
- branch master updated (0682f08 -> 1475582), guix-commits, 2019/04/17
- 01/10: gnu: awesome: Update home page., guix-commits, 2019/04/17
- 02/10: self: Remove unused variable., guix-commits, 2019/04/17
- 04/10: gnu: guix: Don't pass '--with-libgcrypt-prefix'., guix-commits, 2019/04/17
- 06/10: gnu: guix: Update to b8b1e4d., guix-commits, 2019/04/17
- 07/10: installer: Change language as soon as it has been chosen., guix-commits, 2019/04/17
- 09/10: installer: Look up timezone name translations in "iso_3166-1"., guix-commits, 2019/04/17
- 08/10: installer: Display language and territory names natively., guix-commits, 2019/04/17
- 10/10: installer: Sort items with 'string-locale<?'.,
guix-commits <=
- 03/10: build: No longer substitute 'LIBGCRYPT'., guix-commits, 2019/04/17
- 05/10: installer: Desktop environment page now includes window managers., guix-commits, 2019/04/17