mquinson / po4a

Maintain the translations of your documentation with ease (PO for anything)
http://po4a.org/
GNU General Public License v2.0
123 stars 61 forks source link

po4a-translate hangs on unusual .texi markup #313

Open trofi opened 3 years ago

trofi commented 3 years ago

The hangup is observed and worked around in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50144 downstream.

How to reproduce: I'm attaching reproducer.tar.gz with 1.3MB guix.texi.

It's enough to run:

$ po4a-translate -d -M UTF-8 -L UTF-8 -k 0 -f texinfo  -m guix.texi -p guix-manual.de.po -l a.tmp
po4a::transtractor::process: Read PO file guix-manual.de.po
po4a::transtractor::process: Read document guix.texi
po4a::transtractor::process: Call parse()
... <hung> ...

If we apply doc workaround we get quick processing:

--- a/guix.texi
+++ b/guix.texi
@@ -11671,2 +11671 @@ which will be searched for packages.  It accepts as valid arguments:
-@item the URL of a repository as expected by the @code{opam repository
-      add} command (for instance, the URL equivalent of the above
+@item the URL of a repository as expected by the @code{opam repository add} command (for instance, the URL equivalent of the above
$ time po4a-translate -d -M UTF-8 -L UTF-8 -k 0 -f texinfo  -m guix.texi -p guix-manual.de.po -l a.tmp
po4a::transtractor::process: Read PO file guix-manual.de.po
po4a::transtractor::process: Read document guix.texi
po4a::transtractor::process: Call parse()
po4a::transtractor::process: Done parse()
Your input po file guix-manual.de.po seems outdated (The amount of entries differ between files: 0 is not 10507
). Please consider running po4a-updatepo to refresh it.

real    0m4,070s
user    0m3,959s
sys     0m0,013s

Could po4a-translate fail finish faster in this case?

Thanks!

mquinson commented 3 years ago

Hello,

unfortunately, the texinfo parser of po4a is really really experimental for now, and I don't see how to improve it myself. I guess that someone would have to write a new, simpler one.

As a maintainer of po4a, I would be glad to help and assist someone tackling this task, but that's not something I can find the time to do myself anytime soon.

Sorry about this sorry state, Mt.