guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: website: packages: Display the actual number of packages.


From: Ludovic Courtès
Subject: 01/01: website: packages: Display the actual number of packages.
Date: Wed, 19 Aug 2015 13:41:27 +0000

civodul pushed a commit to branch master
in repository guix-artwork.

commit 89258f8f908b76078d9e0fe6183db9b8e8539044
Author: Ludovic Courtès <address@hidden>
Date:   Wed Aug 19 15:40:42 2015 +0200

    website: packages: Display the actual number of packages.
    
    * website/www/packages.scm (number*): New procedure.
      (packages-page): Use it instead of hard-coded package number.
---
 website/www/packages.scm |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/website/www/packages.scm b/website/www/packages.scm
index 7090b30..09da932 100644
--- a/website/www/packages.scm
+++ b/website/www/packages.scm
@@ -34,6 +34,7 @@
   #:use-module (sxml fold)
   #:use-module (web uri)
   #:use-module (ice-9 match)
+  #:use-module (ice-9 i18n)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-19)
   #:export (packages-page))
@@ -248,6 +249,13 @@ description-ids as formal parameters."
           (id "top"))
        "^")))
 
+(define (number* number)
+  "Return NUMBER correctly formatting according to English conventions."
+  (number->locale-string number 0
+                         (or (false-if-exception
+                              (make-locale LC_ALL "en_US.utf8"))
+                             (make-locale LC_ALL "en_US.UTF-8"))))
+
 
 (define (packages-page)
   `(html (@ (lang "en"))
@@ -259,7 +267,9 @@ description-ids as formal parameters."
          (div (@ (id "content-box"))
               (article
                (h1 "Packages")
-               (p "GNU Guix provides 1,500+ packages transparently "
+               (p "GNU Guix provides "
+                   ,(number* (fold-packages (lambda (p n) (+ 1 n)) 0))
+                   " packages transparently "
                   (a (@ (href 
"http://hydra.gnu.org/jobset/gnu/master#tabs-status";))
                      "available as pre-built binaries")
                   ". This is a complete lists of the packages. Our "



reply via email to

[Prev in Thread] Current Thread [Next in Thread]