summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Pelz <pelzflorian@pelzflorian.de>2024-11-01 16:03:15 +0100
committerFlorian Pelz <pelzflorian@pelzflorian.de>2024-11-20 16:01:47 +0100
commit84d5948ee02f6d9aff11603492001eef9df27f95 (patch)
tree7571b8e6631d1096a428323974a8808a956ac185
parent2960720585308e2fdcb44a1ffad5030e06291b5b (diff)
install: Open info manuals that have region codes.
Because pt_PT and pt_BR have many differences, such as how the word “file” gets translated, Guix’ pt_BR info manual is called (guix.pt_BR) instead of (guix.pt). * gnu/system/install.scm (log-to-info): Try region coded manual file names. (%installation-node-names): Add node names for pt_BR and zh_CN. Change-Id: I89beebd323ee69ca83c22321c9d9e664b32cf6f3
-rw-r--r--gnu/system/install.scm29
1 files changed, 18 insertions, 11 deletions
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 78a3cdaaec8..4de903c59b2 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -4,7 +4,7 @@
4;;; Copyright © 2016 Andreas Enge <andreas@enge.fr> 4;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
5;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> 5;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
6;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr> 6;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de> 7;;; Copyright © 2020, 2024 Florian Pelz <pelzflorian@pelzflorian.de>
8;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il> 8;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
9;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz> 9;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
10;;; Copyright © 2023 Herman Rimm <herman@rimm.ee> 10;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
@@ -31,11 +31,9 @@
31 #:use-module (gnu bootloader u-boot) 31 #:use-module (gnu bootloader u-boot)
32 #:use-module (guix gexp) 32 #:use-module (guix gexp)
33 #:use-module (guix store) 33 #:use-module (guix store)
34 #:use-module (guix monads)
35 #:use-module (guix modules) 34 #:use-module (guix modules)
36 #:use-module ((guix packages) #:select (package-version supported-package?)) 35 #:use-module ((guix packages) #:select (package-version supported-package?))
37 #:use-module (guix platform) 36 #:use-module (guix platform)
38 #:use-module ((guix store) #:select (%store-prefix))
39 #:use-module (guix utils) 37 #:use-module (guix utils)
40 #:use-module (gnu installer) 38 #:use-module (gnu installer)
41 #:use-module (gnu system locale) 39 #:use-module (gnu system locale)
@@ -47,7 +45,6 @@
47 #:use-module (gnu packages admin) 45 #:use-module (gnu packages admin)
48 #:use-module (gnu packages bash) 46 #:use-module (gnu packages bash)
49 #:use-module (gnu packages bootloaders) 47 #:use-module (gnu packages bootloaders)
50 #:use-module (gnu packages certs)
51 #:use-module (gnu packages compression) 48 #:use-module (gnu packages compression)
52 #:use-module (gnu packages cryptsetup) 49 #:use-module (gnu packages cryptsetup)
53 #:use-module (gnu packages disk) 50 #:use-module (gnu packages disk)
@@ -60,7 +57,6 @@
60 #:use-module (gnu packages texinfo) 57 #:use-module (gnu packages texinfo)
61 #:use-module (gnu packages xorg) 58 #:use-module (gnu packages xorg)
62 #:use-module (ice-9 match) 59 #:use-module (ice-9 match)
63 #:use-module (srfi srfi-26)
64 #:export (installation-os 60 #:export (installation-os
65 a20-olinuxino-lime-installation-os 61 a20-olinuxino-lime-installation-os
66 a20-olinuxino-lime2-emmc-installation-os 62 a20-olinuxino-lime2-emmc-installation-os
@@ -100,7 +96,9 @@
100 ("en" . "System Installation") 96 ("en" . "System Installation")
101 ("es" . "Instalación del sistema") 97 ("es" . "Instalación del sistema")
102 ("fr" . "Installation du système") 98 ("fr" . "Installation du système")
103 ("ru" . "Установка системы"))) 99 ("pt_BR" . "Instalação do sistema")
100 ("ru" . "Установка системы")
101 ("zh_CN" . "系统安装")))
104 102
105(define (log-to-info tty user) 103(define (log-to-info tty user)
106 "Return a script that spawns the Info reader on the right section of the 104 "Return a script that spawns the Info reader on the right section of the
@@ -111,13 +109,22 @@ manual."
111 (locale (cadr (command-line))) 109 (locale (cadr (command-line)))
112 (language (string-take locale 110 (language (string-take locale
113 (string-index locale #\_))) 111 (string-index locale #\_)))
112 (with-region (string-take locale
113 (string-index
114 locale
115 (char-set #\. #\/ #\@))))
114 (infodir "/run/current-system/profile/share/info") 116 (infodir "/run/current-system/profile/share/info")
115 (per-lang (string-append infodir "/guix." language 117 (per-lang (lambda (code)
116 ".info.gz")) 118 (string-append infodir "/guix." code
117 (file (if (file-exists? per-lang) 119 ".info.gz")))
118 per-lang 120 (file ((@ (srfi srfi-1) find) file-exists?
119 (string-append infodir "/guix.info"))) 121 (list (per-lang with-region)
122 (per-lang language)
123 (string-append infodir
124 "/guix.info.gz"))))
120 (node (or (assoc-ref '#$%installation-node-names 125 (node (or (assoc-ref '#$%installation-node-names
126 with-region)
127 (assoc-ref '#$%installation-node-names
121 language) 128 language)
122 "System Installation"))) 129 "System Installation")))
123 (redirect-port tty (current-output-port)) 130 (redirect-port tty (current-output-port))