questions on parser input output includes initialization and more
by Patrice Dumas
Hello,
I have questions I did not find answers to by reading the documentation,
mainly for TransTractor. In link with the specificities of the Texinfo
format and of the parser I intend to use to define a TransTractor
derived parser (which produces a whole tree for an input file and
included files. That tree can then be split in translated paragraphs,
environment and lines and used to reconstitute the translated output
document).
I have a first question regarding the input. I did not understand
if the shiftline function provides the content of one file or of a
series of files. If a series of files is provided, I guess that it is
up to the parser() to read the reference returned by shiftline and
determine when there is a change in input file. Maybe this could be
documented in the TransTractor manual.
Second, to what extent is it important to read the input file with
shiftline? My understanding is that the shiftline facility is there
to have a way to read the input file line by line, but the parser caller
do not really care about how the input file is read, what really matters
are the calls to translate and to pushline. If the parser() can
determine by the file name and the line, to provide to translate second
argument, it could be used instead of shifltine information. If there
are several files passed through shiftline, then the parser needs to
read all the input be it only to get the list of files to process.
Both for input and output, is there a way to handle included files? It
seems to me that ideally, one translated file for each include file
should be written along with the translation of the main input file,
with modified include directives in translated files including
translated included files to use the translated file names. My
reading of the documentation is that it could be possible for
translate() as there is a reference in argument that could, in
principle, specify a different file than the file passed by shiftline,
but it does not seems to be possible for pushline that only accepts a
line and no information on the file(s) to write to. How is such a
situation supposed to be handled? I had a look at the TeX.pm code, and
it seems that read is redefined but also that the include files are not
translated as files but output together with the main file.
I have another question about the files encoding. Is it possible to
change the encoding based on the the information in the file(s) being
read, both for input and output? In Texinfo, there is a
@documentencoding directive that can be used to specify the encoding,
and it can change within the document (more likely when including a
file). It is becoming less and less relevant now that UTF-8 is
increasingly used for every manual, but still if it is possible to do
something it could be relevant.
Also, there is a @documentlanguage command in Texinfo to specify the
language of the document. It is used by processors, for example, to
translate strings added to the output format, for example the "Appendix"
string could be added and translated depending on the @documentlanguage.
It can also be used to change hyphenation patterns and the like. Is it
possible to have the information on the language being translated to,
such as to add the @documentlanguage at the beginning of the translated
document output? I have not seen anything about that in the
documentation.
It seems that there is an initialize function that can be redefined that
is called (but only by new?). Is it possible to use that function to
initialize the parser globally? Or should it be done in another way?
--
Pat
3 days, 8 hours
po4a v0.74 released
by Martin Quinson
Hello,
I just release a new version of po4a, containing over one year of good changes
from the community. This release is dedicated to Simone Weil, a French
philosopher whose ideas continue to inspire me. She lived true to her beliefs,
practically engaged in many political activities in her communities while
dismissing top-down political parties. She's also an example of what to not do,
in some sense, as she died of extrem asceticism and compation for the suffering
caused by the WW2. Please friends, don't go so hardcore that you die :)
https://en.wikipedia.org/wiki/Simone_Weil
This new version contains many good changes contributed by the community.
Gemmaro contributed three new modules: org, vim-help and SimplePod. The later
one is meant to be a drop-in replacement for the old Pod module that is based
on a deprecated Pod parser. We expect the new module to contain some bugs as it
was not battle tested in production conditions, so we rely on you guys to
report all issues that need to be fixed before removing the old pod module.
Many specific format modules received some love to fix the bugs that were
reported and to implement some missing features: AsciiDoc, Markdown, TeX and
Texinfo. Thanks to all contributors.
The core of the framework was also updated to remove some roting bits. po4a is
over 20 years old, and the Perl language evolved (for the best) since then.
It's about time to fix our Perl usage :)
Finally, the translators did it great with two new translation (Romanian and
Tamil), and an astonishing list of 14 languages over 90% of the program
messages and 9 languages over 90% of the documentation. Thanks to all!
Full changelog:
https://github.com/mquinson/po4a/blob/v0.74/NEWS
Hall of Fame (amount of commits):
7 Alex Karabanov
8 Alexander Golubev
3 Américo Monteiro
1 Anders Jonsson
3 Francisco Serrador
3 Frans Spiesschaert
3 Golubev Alexander
10 Helge Kreutzmann
1 Henk De Groot
13 Hosted Weblate
6 Jean-Noël Avila
2 Marc Dequènes (Duck)
11 Marco Ciampa
63 Martin Quinson
1 Mayeul Cantan
1 Milo Ivir
12 Rafael Fontenelle
12 Remus-Gabriel Chelu
2 Ricky From Hong Kong
1 Shlomi Fish
1 Temuri Doghonadze
5 Yuri Chornoivan
1 Yurt Page
1 ZW
12 eevan78
7 gallegonovato
114 gemmaro
3 mauke
3 ssantos
4 தமிழ்நேரம்
Thanks a lot, and happy translations.
Mt
4 weeks, 1 day
using future Texinfo parser/reader for Texinfo Locale::Po4a parser?
by Patrice Dumas
Hello,
I am a developper of GNU Texinfo. For the next release, we are planning
an interface to a Texinfo Parser/Reader similar to libxml2 reader
(XML::LibXML::Reader) or Pod::Simple::PullParser. I think that it could
be possible to use that Parser/Reader interface to do a Locale::Po4a
parser relatively easily. However, the interface is actually a SWIG
wrapper around internal libraries. Using that interface therefore adds
a requirement on makeinfo/texi2any (or equivalently on the
makeinfo/texi2any internal libraries), which may not be practical for
you.
Would you be interested by a Locale::Po4a Texinfo parser based on this
interface?
--
Pat
1 month
Fwd: Releasing po4a ?
by Fat-Zer
---------- Forwarded message ---------
От: Fat-Zer <fatzer2(a)gmail.com>
Date: ср, 2 июл. 2025 г. в 18:37
Subject: Re: [Po4a-Devel] Releasing po4a ?
To: Martin Quinson <Martin.Quinson(a)ens-rennes.fr>
ср, 2 июл. 2025 г. в 17:49, Martin Quinson <Martin.Quinson(a)ens-rennes.fr>:
>
> Hello friends,
>
> do someone have something ongoing, or we could think about releasing a version
> of po4a before the (north) summer break?
>
> Thanks in advance,
> Mt
> _______________________________________________
> Devel mailing list -- devel(a)lists.po4a.org
> To unsubscribe send an email to devel-leave(a)lists.po4a.org
Hi, the PR #540 [1] is quite ready to be merged. The only thing is to
decide if we need those additional checks. Also If there is some time,
I would like to tuckle up issue #551 [2], as I kinda started it, but
got carried away.
[1]: https://github.com/mquinson/po4a/pull/540
[2]: https://github.com/mquinson/po4a/issues/551
1 month, 1 week
Releasing po4a ?
by Martin Quinson
Hello friends,
do someone have something ongoing, or we could think about releasing a version
of po4a before the (north) summer break?
Thanks in advance,
Mt
1 month, 1 week