From patchwork Sun Nov 17 23:48:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "pelzflorian (Florian Pelz)" X-Patchwork-Id: 70491 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B7C1E27BBE2; Sun, 17 Nov 2024 23:49:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A9F2927BBEA for ; Sun, 17 Nov 2024 23:49:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCp0q-0001Rr-LG; Sun, 17 Nov 2024 18:49:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tCp0q-0001Rh-04 for guix-patches@gnu.org; Sun, 17 Nov 2024 18:49:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tCp0p-0001c6-NY for guix-patches@gnu.org; Sun, 17 Nov 2024 18:49:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=amJk9z7bkypC0MsBLwHuKdz5RyhA+FTcTjTjhLJIhpI=; b=ITTSiPRGr4hRUxqtLxoVFp+3NqTTI+c0H/Uu6R3tGuIP/BamAfNKTj0n9ilBG5qi+Z9IR8Ia2VBpm7wJUj9oeRF109P6KS6P4H1MKdbdRe3CzbRYqJHdBc0/4ly/P9VtxKp2l4JzNLK6zjzqjw/jTpiZJq6VE3q/bTIUHIQn3oVSTqS5Ibac/c7QjZfGxmfPNwt2h8eJEVRqefsGeWtmcbDCJHMoH0uUXqPvkrekP9K29lzEBoMqgPMt/Q5Z/NNHpxZjMEk2abnM/d716hOGE9ikzq9UsIOSYhah4+ksWi4+9vRCD3SKv0QNu/54hUK0Y/pWSTs4i5gXjNLdj7BWaw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCp0o-0005wA-K6 for guix-patches@gnu.org; Sun, 17 Nov 2024 18:49:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74190] [PATCH v2 1/3] install: Open info manuals that have region codes. Resent-From: Florian Pelz Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Nov 2024 23:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74190 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74190@debbugs.gnu.org Cc: Florian Pelz Received: via spool by 74190-submit@debbugs.gnu.org id=B74190.173188730022752 (code B ref 74190); Sun, 17 Nov 2024 23:49:02 +0000 Received: (at 74190) by debbugs.gnu.org; 17 Nov 2024 23:48:20 +0000 Received: from localhost ([127.0.0.1]:59113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCp07-0005us-Ko for submit@debbugs.gnu.org; Sun, 17 Nov 2024 18:48:20 -0500 Received: from relay.yourmailgateway.de ([46.38.247.119]:51061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCp04-0005ue-Lf for 74190@debbugs.gnu.org; Sun, 17 Nov 2024 18:48:18 -0500 Received: from mors-relay-8404.netcup.net (localhost [127.0.0.1]) by mors-relay-8404.netcup.net (Postfix) with ESMTPS id 4Xs6rv5wH2z83DS for <74190@debbugs.gnu.org>; Mon, 18 Nov 2024 00:48:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pelzflorian.de; s=key2; t=1731887295; bh=JfHGZAMwWt5r6yI8DnDRsGpctX8c3LKWwtpbZ221m6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VSEsiy6HAQSJXOnvVIs0svoGE4OQxUhOL34nBk+kDEybcU8UQhU4TwjJ6s8U02Fuz A873VNZksZ+GeHfpncAkp6FIDp2dx9Q1UITo2qxmtBkUqQVWP6TtbfnSM5LadalFbx K3anLAcMrfhPfi3EwYF2SSoKUHKgmuIDnwtMLqODj7VRpz81M0nyQUiUc6SueV4Gec /gfuAW1Wymx8zxTnwJRfrUVH6MV2SaDjcfXynCv1FJTXwgJjFxFcUm4XxjPthh3/2A vNtd1FKEoJP+7q/f87nUMFSKYthFYQH2GGqwquz4a2lR/80lNgVtIrg5lQnsrmW/bf /n0kMJh6auvMg== Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-8404.netcup.net (Postfix) with ESMTPS id 4Xs6rv5YBQz4xHn for <74190@debbugs.gnu.org>; Mon, 18 Nov 2024 00:48:15 +0100 (CET) Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4Xs6rv43RSz8sWQ for <74190@debbugs.gnu.org>; Mon, 18 Nov 2024 00:48:14 +0100 (CET) Received: from florianhp.fritz.box (ipb218687b.dynamic.kabel-deutschland.de [178.24.104.123]) by mxe217.netcup.net (Postfix) with ESMTPSA id 78903841DA; Mon, 18 Nov 2024 00:48:09 +0100 (CET) From: Florian Pelz Date: Mon, 18 Nov 2024 00:48:16 +0100 Message-ID: <7f9cc4f5378a22f2fb2891403fbc4714bb5b8f34.1731881786.git.pelzflorian@pelzflorian.de> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 78903841DA X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: YBnJdVTXYC8DE1uxBh8YOCmsAClJfocHZzebFD0oJ1OHw2cGKrgWhcU8 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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 --- 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 ;;; Copyright © 2017 Marius Bakke ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice -;;; Copyright © 2020 Florian Pelz +;;; Copyright © 2020, 2024 Florian Pelz ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2022 Josselin Poiret ;;; Copyright © 2023 Herman Rimm @@ -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))