GNU bug report logs - #62625
[PATCH] po: Do not auto-translate cross-references to other manuals.

Previous Next

Package: guix-patches;

Reported by: Florian Pelz <pelzflorian <at> pelzflorian.de>

Date: Sun, 2 Apr 2023 18:47:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62625 in the body.
You can then email your comments to 62625 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to ludo <at> gnu.org, guix-patches <at> gnu.org:
bug#62625; Package guix-patches. (Sun, 02 Apr 2023 18:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Florian Pelz <pelzflorian <at> pelzflorian.de>:
New bug report received and forwarded. Copy sent to ludo <at> gnu.org, guix-patches <at> gnu.org. (Sun, 02 Apr 2023 18:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Florian Pelz <pelzflorian <at> pelzflorian.de>
To: guix-patches <at> gnu.org
Cc: Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: [PATCH] po: Do not auto-translate cross-references to other manuals.
Date: Sun,  2 Apr 2023 20:44:01 +0200
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.
---
 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 <at> lepiller.eu>
 ;;; Copyright © 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2023 Florian Pelz <pelzflorian <at> pelzflorian.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -123,7 +124,15 @@ (define (canonicalize-whitespace str)
 
 (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 @@ (define translated
           (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)

base-commit: 47ea688fd27d0ce0c8ea5481f1f94d0ebc3e37eb
-- 
2.39.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 07 Apr 2023 14:55:02 GMT) Full text and rfc822 format available.

Notification sent to Florian Pelz <pelzflorian <at> pelzflorian.de>:
bug acknowledged by developer. (Fri, 07 Apr 2023 14:55:02 GMT) Full text and rfc822 format available.

Message #10 received at 62625-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Florian Pelz <pelzflorian <at> pelzflorian.de>
Cc: 62625-done <at> debbugs.gnu.org
Subject: Re: bug#62625: [PATCH] po: Do not auto-translate cross-references
 to other manuals.
Date: Fri, 07 Apr 2023 16:54:33 +0200
Hi Florian,

Florian Pelz <pelzflorian <at> pelzflorian.de> skribis:

> 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.

Applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 May 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 137 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.