Some manual @ref @xref @pxref fail when untranslated

  • Done
  • quality assurance status badge
Details
3 participants
  • Julien Lepiller
  • Meiyo Peng
  • pelzflorian (Florian Pelz)
Owner
unassigned
Submitted by
pelzflorian (Florian Pelz)
Severity
normal
P
P
pelzflorian (Florian Pelz) wrote on 18 May 2019 00:48
(name . Meiyo Peng)(address . meiyo@riseup.net)
20190517224826.4cy2aymsxaa5sehz@pelzflorian.localdomain

On Tue, May 14, 2019 at 10:29:35AM +0800, Meiyo Peng wrote:
Toggle quote (12 lines)
> I just find out that the @pxref{Packages with Multiple Outputs} in
> doc/contributing.texi has to be translated. Or I will get an error
> while running make:
>
> #+begin_example
> doc/contributing.zh_CN.texi:567: @pxref reference to nonexistent node `Packages with Multiple Outputs'
> #+end_example
>
> I guess it's because the node name is in doc/guix.texi (another file
> than doc/contributing.texi). Any idea?
>

The reason appears to be that when not translating (using the first
attached patch that reverts back to @pxref{Packages with Multiple
Outputs}), po4a-translate transforms

@item
Take a look at the profile reported by @command{guix size}
(@pxref{Invoking guix size}). This will allow you to notice references
to other packages unwillingly retained. It may also help determine
whether to split the package (@pxref{Packages with Multiple Outputs}),
and which optional dependencies should be used. In particular, avoid adding
@code{texlive} as a dependency: because of its extreme size, use
@code{texlive-tiny} or @code{texlive-union} instead.

to

@item
???@command{guix size}?@pxref{Invoking guix
size}????????????????????????????????????????????????????@pxref{Packages
with Multiple
Outputs}???????????????????????@code{texlive}????????????????@code{texlive-tiny}?@code{texlive-union}????

with the pxref split over three lines because the surrounding context
has no space characters. doc/local.mk’s xref_command can only deal
with two lines however.

The second attached patch makes xref_command grep three-line
references too, so it finds the translation, *however* I cannot get
this multiline sed to actually insert the translation into three line
references. Perhaps it would be better to just replace this complex
xref_command with Guile code? I will not do it however.

I am Cc’ing the bug-guix@gnu.org; I hope this is OK.

Regards,
Florian
From 267cc4c506d03ad35bfeead0f45d77bc7d242181 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 18 May 2019 00:29:21 +0200
Subject: [PATCH 1/2] THIS IS A TEST: Revert to not translating pxref
reference.

---
po/doc/guix-manual.zh_CN.po | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/po/doc/guix-manual.zh_CN.po b/po/doc/guix-manual.zh_CN.po
index c24900da31..d1351ef557 100644
--- a/po/doc/guix-manual.zh_CN.po
+++ b/po/doc/guix-manual.zh_CN.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: guix-manual 1.0.1-pre1\n"
"Report-Msgid-Bugs-To: ludo@gnu.org\n"
"POT-Creation-Date: 2019-05-10 20:53+0200\n"
-"PO-Revision-Date: 2019-05-14 14:31+0800\n"
+"PO-Revision-Date: 2019-05-17 17:21+0200\n"
"Last-Translator: Meiyo Peng <meiyo@riseup.net>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
@@ -1237,7 +1237,7 @@ msgstr "????????????????????????
#. type: enumerate
#: doc/contributing.texi:868
msgid "Take a look at the profile reported by @command{guix size} (@pxref{Invoking guix size}). This will allow you to notice references to other packages unwillingly retained. It may also help determine whether to split the package (@pxref{Packages with Multiple Outputs}), and which optional dependencies should be used. In particular, avoid adding @code{texlive} as a dependency: because of its extreme size, use @code{texlive-tiny} or @code{texlive-union} instead."
-msgstr "???@command{guix size}?@pxref{Invoking guix size}????????????????????????????????????????????????????@pxref{?????????}???????????????????????@code{texlive}????????????????@code{texlive-tiny}?@code{texlive-union}????"
+msgstr "???@command{guix size}?@pxref{Invoking guix size}????????????????????????????????????????????????????@pxref{Packages with Multiple Outputs}???????????????????????@code{texlive}????????????????@code{texlive-tiny}?@code{texlive-union}????"
#. type: enumerate
#: doc/contributing.texi:873
--
2.21.0
From f9c3aae82c940238e6162e16cef0431ce782f5f3 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 18 May 2019 00:31:06 +0200
Subject: [PATCH 2/2] doc: Insufficient attempt to fix translation of
three-line references.

* doc/local.mk (xref_command): Catch three-line translations as well, but the
multiline sed still covers only two lines.
---
doc/local.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/doc/local.mk b/doc/local.mk
index 336e961c4f..645e571817 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -88,7 +88,7 @@ PO4A_PARAMS += -f texinfo # texinfo format
# reference name, even in untranslated strings.
# The last sed is a multiline sed because some references span multiple lines.
define xref_command
-cat "$@.tmp" | egrep '@p?x?ref' -A1 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \
+cat "$@.tmp" | egrep '@p?x?ref' -A2 | sed 'N;s|--\n||g;P;D' | sed 's|^| |g' | \
tr -d '\012' | sed 's|\(@p\?x\?ref\)|\n\1|g' | egrep '@p?x?ref' | \
sed 's|^.*@p\?x\?ref{\([^,}]*\).*$$|\1|g' | sort | uniq | while read e; do \
line=$$(grep -n "^msgid \"$$e\"" "$<" | cut -f1 --delimiter=":") ;\
--
2.21.0
J
J
Julien Lepiller wrote on 18 May 2019 09:40
6AC44E83-CD88-4DB6-AA71-A134378DAAC9@lepiller.eu
Le 18 mai 2019 00:48:26 GMT+02:00, "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> a écrit :
Toggle quote (54 lines)
>Meiyo Peng reports at
><https://lists.gnu.org/archive/html/guix-devel/2019-05/msg00275.html>
>
>On Tue, May 14, 2019 at 10:29:35AM +0800, Meiyo Peng wrote:
>> I just find out that the @pxref{Packages with Multiple Outputs} in
>> doc/contributing.texi has to be translated. Or I will get an error
>> while running make:
>>
>> #+begin_example
>> doc/contributing.zh_CN.texi:567: @pxref reference to nonexistent
>node `Packages with Multiple Outputs'
>> #+end_example
>>
>> I guess it's because the node name is in doc/guix.texi (another file
>> than doc/contributing.texi). Any idea?
>>
>
>The reason appears to be that when not translating (using the first
>attached patch that reverts back to @pxref{Packages with Multiple
>Outputs}), po4a-translate transforms
>
>@item
>Take a look at the profile reported by @command{guix size}
>(@pxref{Invoking guix size}). This will allow you to notice references
>to other packages unwillingly retained. It may also help determine
>whether to split the package (@pxref{Packages with Multiple Outputs}),
>and which optional dependencies should be used. In particular, avoid
>adding
>@code{texlive} as a dependency: because of its extreme size, use
>@code{texlive-tiny} or @code{texlive-union} instead.
>
>to
>
>@item
>???@command{guix size}?@pxref{Invoking guix
>size}????????????????????????????????????????????????????@pxref{Packages
>with Multiple
>Outputs}???????????????????????@code{texlive}????????????????@code{texlive-tiny}?@code{texlive-union}????
>
>with the pxref split over three lines because the surrounding context
>has no space characters. doc/local.mk’s xref_command can only deal
>with two lines however.
>
>The second attached patch makes xref_command grep three-line
>references too, so it finds the translation, *however* I cannot get
>this multiline sed to actually insert the translation into three line
>references. Perhaps it would be better to just replace this complex
>xref_command with Guile code? I will not do it however.
>
>I am Cc’ing the bug-guix@gnu.org; I hope this is OK.
>
>Regards,
>Florian

We have some guile code for doing exactly that in guix pull, so we could reuse it here.
M
M
Meiyo Peng wrote on 23 May 2019 06:05
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
875zq1yfwb.fsf@riseup.net
Hi Florian,

pelzflorian (Florian Pelz) writes:

Toggle quote (40 lines)
>
> On Tue, May 14, 2019 at 10:29:35AM +0800, Meiyo Peng wrote:
>> I just find out that the @pxref{Packages with Multiple Outputs} in
>> doc/contributing.texi has to be translated. Or I will get an error
>> while running make:
>>
>> #+begin_example
>> doc/contributing.zh_CN.texi:567: @pxref reference to nonexistent node `Packages with Multiple Outputs'
>> #+end_example
>>
>> I guess it's because the node name is in doc/guix.texi (another file
>> than doc/contributing.texi). Any idea?
>>
>
> The reason appears to be that when not translating (using the first
> attached patch that reverts back to @pxref{Packages with Multiple
> Outputs}), po4a-translate transforms
>
> @item
> Take a look at the profile reported by @command{guix size}
> (@pxref{Invoking guix size}). This will allow you to notice references
> to other packages unwillingly retained. It may also help determine
> whether to split the package (@pxref{Packages with Multiple Outputs}),
> and which optional dependencies should be used. In particular, avoid adding
> @code{texlive} as a dependency: because of its extreme size, use
> @code{texlive-tiny} or @code{texlive-union} instead.
>
> to
>
> @item
> ???@command{guix size}?@pxref{Invoking guix
> size}????????????????????????????????????????????????????@pxref{Packages
> with Multiple
> Outputs}???????????????????????@code{texlive}????????????????@code{texlive-tiny}?@code{texlive-union}????
>
> with the pxref split over three lines because the surrounding context
> has no space characters. doc/local.mk’s xref_command can only deal
> with two lines however.

There is no space separator for Chinese words. Typesetting of CJK
languages is always a headache for FLOSS developers.

Toggle quote (6 lines)
> The second attached patch makes xref_command grep three-line
> references too, so it finds the translation, *however* I cannot get
> this multiline sed to actually insert the translation into three line
> references. Perhaps it would be better to just replace this complex
> xref_command with Guile code? I will not do it however.

Thank you for the work. I have found only one such case in the Guix
manual, so that's fine. I can manually translate this @pxref.


--
Meiyo Peng
P
P
pelzflorian (Florian Pelz) wrote on 11 Jun 2022 13:24
(address . 35786-done@debbugs.gnu.org)
20220611112349.prups45xtbvuaup7@pelzflorian.localdomain
On Sat, May 18, 2019 at 12:48:26AM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (5 lines)
> […]po4a-translate transforms […]to[…]
> ?@pxref{Packages
> with Multiple
> Outputs}??

Julien fixed it with 0623138ffa5b066afc25547ffdeb97753cb0ee9a

Closing.

Regards,
Florian
Closed
?