[PATCH 0/3] install: Enable pt_BR translation.

  • Open
  • quality assurance status badge
Details
2 participants
  • Krascovict Petrov
  • Florian Pelz
Owner
unassigned
Submitted by
Florian Pelz
Severity
normal
F
F
Florian Pelz wrote on 3 Nov 16:14 +0100
(address . guix-patches@gnu.org)(name . Florian Pelz)(address . pelzflorian@pelzflorian.de)
cover.1730645617.git.pelzflorian@pelzflorian.de
Hello. The goal of these patches is to make the pt_BR translation,
that had been expanded much on Weblate recently,
usable in the Guix System latest installer.

Florian Pelz (3):
install: Open info manuals that have region codes.
install: Change the territory when we have learned it.
gnu: info-reader: Inherit from texinfo-7.

gnu/installer/newt/locale.scm | 17 ++++++++++-------
gnu/packages/texinfo.scm | 2 +-
gnu/system/install.scm | 29 ++++++++++++++++++-----------
3 files changed, 29 insertions(+), 19 deletions(-)


base-commit: 20c7b8dd04e421a139a02438cf1ddfdfe544a446
--
2.46.0
F
F
Florian Pelz wrote on 3 Nov 16:25 +0100
[PATCH 1/3] install: Open info manuals that have region codes.
(address . 74190@debbugs.gnu.org)(name . Florian Pelz)(address . pelzflorian@pelzflorian.de)
e8248c0cf7bd253d553464142e6e35990c2ef14e.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(-)

Toggle diff (82 lines)
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
F
F
Florian Pelz wrote on 3 Nov 16:25 +0100
[PATCH 2/3] install: Change the territory when we have learned it.
(address . 74190@debbugs.gnu.org)(name . Florian Pelz)(address . pelzflorian@pelzflorian.de)
1e50d2858a80c891f3b7fa377e5b876c475f9e92.1730645617.git.pelzflorian@pelzflorian.de
Typically, the LANGUAGE has already been set in the run-language-page
step. But for languages like pt, we must know the territory.

gnu/installer/newt/locale.scm (run-territory-page): Switch to
the territory before returning it.

Change-Id: Ie6308c359e0bdb2d37fac0c844cfd879e96e231a
---
gnu/installer/newt/locale.scm | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

Toggle diff (52 lines)
diff --git a/gnu/installer/newt/locale.scm b/gnu/installer/newt/locale.scm
index 01171e253f..1743e0d582 100644
--- a/gnu/installer/newt/locale.scm
+++ b/gnu/installer/newt/locale.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2024 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -22,11 +23,7 @@ (define-module (gnu installer newt locale)
#:use-module (gnu installer steps)
#:use-module (gnu installer newt page)
#:use-module (guix i18n)
- #:use-module (newt)
#:use-module (srfi srfi-1)
- #:use-module (srfi srfi-26)
- #:use-module (srfi srfi-34)
- #:use-module (srfi srfi-35)
#:use-module (ice-9 match)
#:export (run-locale-page))
@@ -52,16 +49,22 @@ (define (run-language-page languages language->text)
result)
(define (run-territory-page territories territory->text)
- (let ((title (G_ "Locale location")))
+ (define result
(run-listbox-selection-page
- #:title title
+ #:title (G_ "Locale location")
#:info-text (G_ "Choose a territory for this language.")
#:listbox-items territories
#:listbox-item->text territory->text
#:button-text (G_ "Back")
#:button-callback-procedure
(lambda _
- (abort-to-prompt 'installer-step 'abort)))))
+ (abort-to-prompt 'installer-step 'abort))))
+
+ ;; Some languages, such as pt, cannot be installed early in the
+ ;; run-language-page step. Install them now, when we know the territory.
+ (setenv "LANGUAGE" (string-append (getenv "LANGUAGE") "_" result))
+
+ result)
(define (run-codeset-page codesets)
(let ((title (G_ "Locale codeset")))
--
2.46.0
F
F
Florian Pelz wrote on 3 Nov 16:25 +0100
[PATCH 3/3] gnu: info-reader: Inherit from texinfo-7.
(address . 74190@debbugs.gnu.org)(name . Florian Pelz)(address . pelzflorian@pelzflorian.de)
cfdc2a4d550d1ec1793971b17b5762d7215394fc.1730645617.git.pelzflorian@pelzflorian.de
Otherwise `LC_ALL=pt_BR.utf8 info` crashes.

* gnu/packages/texinfo.scm (info-reader): Inherit from texinfo-7.

Change-Id: I9eb5873fbc115e0c45f96a16aa05dbca76b92c57
---
I have not carefully thought about the consequences of this change,
but it makes info work for the installer in pt_BR.

gnu/packages/texinfo.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/texinfo.scm b/gnu/packages/texinfo.scm
index 81afdaf7a7..e198581b52 100644
--- a/gnu/packages/texinfo.scm
+++ b/gnu/packages/texinfo.scm
@@ -194,7 +194,7 @@ (define-public texinfo-4
(define-public info-reader
;; The idea of this package is to have the standalone Info reader without
;; the dependency on Perl that 'makeinfo' drags.
- (package/inherit texinfo
+ (package/inherit texinfo-7
(name "info-reader")
(arguments
`(,@(substitute-keyword-arguments (package-arguments texinfo)
--
2.46.0
K
K
Krascovict Petrov wrote on 3 Nov 21:37 +0100
[PATCH 0/3] install: Enable pt_BR translation.
(name . 74190@debbugs.gnu.org)(address . 74190@debbugs.gnu.org)
26101730666097@mail.yandex.ru
Attachment: file
P
P
pelzflorian (Florian Pelz) wrote on 4 Nov 08:52 +0100
(name . Krascovict Petrov)(address . krascovict@yandex.ru)(name . 74190@debbugs.gnu.org)(address . 74190@debbugs.gnu.org)
87cyjbo2pi.fsf@pelzflorian.de
Hello Krascovict and thank you for translating.

Note that I do not speak Portuguese.

Krascovict Petrov <krascovict@yandex.ru> writes:
Toggle quote (3 lines)
> In this case I am in doubt about translations of functions (inside the
> parentheses) whether they can be translated or not?

Generally no, but you can look at the string in Weblate in other
languages like Spanish or French. See if they have translated it.
For example, if a variable name is defined with (define), in a few
cases, it is possible to translate it, but it must be translated
everywhere the same way.

Alternatively you would have to test in Guix if it works.

Regards,
Florian
K
K
Krascovict Petrov wrote on 4 Nov 23:08 +0100
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(name . 74190@debbugs.gnu.org)(address . 74190@debbugs.gnu.org)
4462491730758010@mail.yandex.ru
Attachment: file
P
P
pelzflorian (Florian Pelz) wrote on 5 Nov 09:59 +0100
(name . Krascovict Petrov)(address . krascovict@yandex.ru)(name . 74190@debbugs.gnu.org)(address . 74190@debbugs.gnu.org)
87v7x2vywp.fsf@pelzflorian.de
Krascovict Petrov <krascovict@yandex.ru> writes:
Toggle quote (3 lines)
> I understand Florian Pelz, at first I will translate the texts, when I reach 100% translation I will test it on a virtual machine and do tests, thank
> you for the congratulations.

Yes, but I do recommend looking at Spanish or French for difficult,
ambiguous translations, particularly in some services’ ambiguous texts.
100% is a difficult goal for some of them, and correctness is more
important than having a translation. For example, you and other
translators frequently translated a graph from graph theory like
gráfico, or the /gnu/store store like loja (shop), which I then changed
to the word armazém from Guix’ Portuguese glossary.

Regards,
Florian
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 74190@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74190
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch