[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
138/244: po: Do not auto-translate cross-references to other manuals.
From: |
guix-commits |
Subject: |
138/244: po: Do not auto-translate cross-references to other manuals. |
Date: |
Wed, 12 Apr 2023 08:49:06 -0400 (EDT) |
apteryx pushed a commit to branch staging
in repository guix.
commit 83ee4dcf87943167e15efff29c59fd92a28668b7
Author: Florian Pelz <pelzflorian@pelzflorian.de>
AuthorDate: Sun Apr 2 20:44:01 2023 +0200
po: Do not auto-translate cross-references to other manuals.
Reported by Gottfried at
<https://lists.gnu.org/archive/html/help-guix/2023-04/msg00000.html>.
* guix/build/po.scm (xref-regexp): Dispatch on the number of
arguments. Ensure there is no info-manual argument or it is empty.
(translate-cross-references): Adapt to changed regexp.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/build/po.scm | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/guix/build/po.scm b/guix/build/po.scm
index 7f88164cd8..62362e933e 100644
--- a/guix/build/po.scm
+++ b/guix/build/po.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2021 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2023 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -123,7 +124,15 @@ and the value is the msgstr. The result only contains non
fuzzy strings."
(define xref-regexp
;; Texinfo cross-reference regexp.
- (make-regexp "@(px|x)?ref\\{([^,}]+)"))
+ (make-regexp
+ (string-append "@(px|x)?ref\\{([^,}]+)("
+ "\\}" ;Match xref with one argument
+ "|,[^,}]*\\}" ;or two arguments
+ "|,[^,}]*,[^,}]*\\}" ;or three arguments
+ ;; or with an *empty* fourth argument:
+ "|,[^,}]*,[^,}]*, *,"
+ "|,[^,}]*,[^,}]*, *\\}"
+ ")")))
(define (translate-cross-references texi pofile)
"Translate the cross-references that appear in @var{texi}, the initial
@@ -157,13 +166,15 @@ translation of a Texinfo file, using the msgid/msgstr
pairs from @var{pofile}."
(cons (string-drop content offset) result)))
((head . tail)
(let ((prefix (match:substring head 1))
- (ref (canonicalize-whitespace (match:substring head 2))))
+ (ref (canonicalize-whitespace (match:substring head 2)))
+ (rest (match:substring head 3)))
(define translated
(string-append "@" (or prefix "")
"ref{"
(match (vhash-assoc ref translation-map)
(#f ref)
- ((_ . str) str))))
+ ((_ . str) str))
+ (or rest "")))
(loop tail
(match:end head)
- 86/244: gnu: r-numbat: Update to 1.3.0., (continued)
- 86/244: gnu: r-numbat: Update to 1.3.0., guix-commits, 2023/04/12
- 109/244: gnu: r-projpred: Update to 2.5.0., guix-commits, 2023/04/12
- 113/244: gnu: r-readtext: Update to 0.82., guix-commits, 2023/04/12
- 117/244: gnu: r-lattice: Update to 0.21-8., guix-commits, 2023/04/12
- 121/244: gnu: r-rsqlite: Update to 2.3.1., guix-commits, 2023/04/12
- 126/244: gnu: tcsh: Fix riscv64 cross-compilation., guix-commits, 2023/04/12
- 125/244: gnu: Add avfs., guix-commits, 2023/04/12
- 129/244: environment: Add '--nesting'., guix-commits, 2023/04/12
- 127/244: gnu: janet: Update to 1.27.0., guix-commits, 2023/04/12
- 134/244: news: Add 'de' translation., guix-commits, 2023/04/12
- 138/244: po: Do not auto-translate cross-references to other manuals.,
guix-commits <=
- 21/244: gnu: Add python-treelib., guix-commits, 2023/04/12
- 32/244: gnu: a2ps: Update to 4.15.3., guix-commits, 2023/04/12
- 48/244: gnu: python-debian: Update to 0.1.49., guix-commits, 2023/04/12
- 49/244: gnu: python-boolean.py: Update to 4.0., guix-commits, 2023/04/12
- 52/244: gnu: emacs-eat: Update to 0.7., guix-commits, 2023/04/12
- 56/244: gnu: mixxx: Update to 2.3.4., guix-commits, 2023/04/12
- 57/244: gnu: pre-commit: Update to 3.2.2., guix-commits, 2023/04/12
- 63/244: gnu: kdenlive: Update to 22.12.3., guix-commits, 2023/04/12
- 70/244: gnu: Add r-targets., guix-commits, 2023/04/12
- 95/244: gnu: r-ellipse: Update to 0.4.5., guix-commits, 2023/04/12