unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Florian Pelz <pelzflorian@pelzflorian.de>
To: 74190@debbugs.gnu.org
Cc: Florian Pelz <pelzflorian@pelzflorian.de>
Subject: [bug#74190] [PATCH 1/3] install: Open info manuals that have region codes.
Date: Sun,  3 Nov 2024 16:25:40 +0100	[thread overview]
Message-ID: <e8248c0cf7bd253d553464142e6e35990c2ef14e.1730645617.git.pelzflorian@pelzflorian.de> (raw)
In-Reply-To: <cover.1730645617.git.pelzflorian@pelzflorian.de>

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
---
NOTE: This patch also causes the Chinese manual to be opened for zh_CN,
which is somewhat broken during installation, because Chinese characters
cannot be displayed on an ordinary TTY.  I have made only trivial
attempts to run kmscon from documentation-shepherd-service, which failed.
But including this patch still seems proper to me despite trouble with
zh_CN.

pt_BR is also troubled by the texinfo info-reader crashing, which is
addressed in patch 3/3.

 gnu/system/install.scm | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 78a3cdaaec..4de903c59b 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
+;;; Copyright © 2020, 2024 Florian Pelz <pelzflorian@pelzflorian.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
 ;;; Copyright © 2023 Herman Rimm <herman@rimm.ee>
@@ -31,11 +31,9 @@ (define-module (gnu system install)
   #:use-module (gnu bootloader u-boot)
   #:use-module (guix gexp)
   #:use-module (guix store)
-  #:use-module (guix monads)
   #:use-module (guix modules)
   #:use-module ((guix packages) #:select (package-version supported-package?))
   #:use-module (guix platform)
-  #:use-module ((guix store) #:select (%store-prefix))
   #:use-module (guix utils)
   #:use-module (gnu installer)
   #:use-module (gnu system locale)
@@ -47,7 +45,6 @@ (define-module (gnu system install)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bootloaders)
-  #:use-module (gnu packages certs)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cryptsetup)
   #:use-module (gnu packages disk)
@@ -60,7 +57,6 @@ (define-module (gnu system install)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages xorg)
   #:use-module (ice-9 match)
-  #:use-module (srfi srfi-26)
   #:export (installation-os
             a20-olinuxino-lime-installation-os
             a20-olinuxino-lime2-emmc-installation-os
@@ -100,7 +96,9 @@ (define %installation-node-names
     ("en" . "System Installation")
     ("es" . "Instalación del sistema")
     ("fr" . "Installation du système")
-    ("ru" . "Установка системы")))
+    ("pt_BR" . "Instalação do sistema")
+    ("ru" . "Установка системы")
+    ("zh_CN" . "系统安装")))
 
 (define (log-to-info tty user)
   "Return a script that spawns the Info reader on the right section of the
@@ -111,13 +109,22 @@ (define (log-to-info tty user)
                          (locale   (cadr (command-line)))
                          (language (string-take locale
                                                 (string-index locale #\_)))
+                         (with-region (string-take locale
+                                                   (string-index
+                                                    locale
+                                                    (char-set #\. #\/ #\@))))
                          (infodir  "/run/current-system/profile/share/info")
-                         (per-lang (string-append infodir "/guix." language
-                                                  ".info.gz"))
-                         (file     (if (file-exists? per-lang)
-                                       per-lang
-                                       (string-append infodir "/guix.info")))
+                         (per-lang (lambda (code)
+                                     (string-append infodir "/guix." code
+                                                    ".info.gz")))
+                         (file ((@ (srfi srfi-1) find) file-exists?
+                                (list (per-lang with-region)
+                                      (per-lang language)
+                                      (string-append infodir
+                                                     "/guix.info.gz"))))
                          (node     (or (assoc-ref '#$%installation-node-names
+                                                  with-region)
+                                       (assoc-ref '#$%installation-node-names
                                                   language)
                                        "System Installation")))
                     (redirect-port tty (current-output-port))
-- 
2.46.0





  reply	other threads:[~2024-11-03 15:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-03 15:14 [bug#74190] [PATCH 0/3] install: Enable pt_BR translation Florian Pelz
2024-11-03 15:25 ` Florian Pelz [this message]
2024-11-03 15:25 ` [bug#74190] [PATCH 2/3] install: Change the territory when we have learned it Florian Pelz
2024-11-03 15:25 ` [bug#74190] [PATCH 3/3] gnu: info-reader: Inherit from texinfo-7 Florian Pelz
2024-11-03 20:37 ` [bug#74190] [PATCH 0/3] install: Enable pt_BR translation Krascovict Petrov
2024-11-04  7:52   ` pelzflorian (Florian Pelz)
2024-11-04 22:08     ` Krascovict Petrov
2024-11-05  8:59       ` pelzflorian (Florian Pelz)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8248c0cf7bd253d553464142e6e35990c2ef14e.1730645617.git.pelzflorian@pelzflorian.de \
    --to=pelzflorian@pelzflorian.de \
    --cc=74190@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).