Simplified Chinese translation for po4a
by hottea
hi,
dear all.
I'm not sure if I have join this mail list. I don't know how to join as there isn't a how-to on the website. I hope you can receive my email.
I found po4a when doing some translation, and found that there's not a complete Simplified Chinese translation for po4a, so I do the work. I create a project on transifex, a localization platform, see www.transifex.com/projects/p/po4a-translation. I wonder how could I see the final result? Where are the translation installed?
If you're interested in the Simplified Chinese translation for po4a, please join the language team on transifex.com, you can also request language on transifex.
-----
send from hottea's openSUSE
3 years, 9 months
Fwd: Re: Example of dumper (along with references) using Pod::Simple?
by Martin Quinson
Another blocked mail that deserves a better treatment.
Mt
----- Forwarded message from Russ Allbery <rra(a)cpan.org> -----
Date: Mon, 25 May 2020 09:48:19 -0700
From: Russ Allbery <rra(a)cpan.org>
To: Martin Quinson <martin.quinson(a)ens-rennes.fr>
Cc: pod-people(a)perl.org, devel(a)lists.po4a.org
Subject: Re: Example of dumper (along with references) using Pod::Simple?
Organization: The Eyrie
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Martin Quinson <martin.quinson(a)ens-rennes.fr> writes:
> I had a look at Pod::Simple to see how to convert po4a to the
> modernity, but I would appreciate to have some guidance, please. For
> reference, our code is here:
> https://github.com/mquinson/po4a/blob/master/lib/Locale/Po4a/Pod.pm
> For now, we override initialize(), command(), verbatim() and
> textblock() and then call parse_from_file() on the provided file.
Pod::Simple has a very different organizational structure than Pod::Parser
and it will probably require some reworking or a compatibility layer to
adapt Pod::Parser code to it. To understand how Pod::Simple natively
thinks about passing information to you, you'll want to look at:
Pod::Simple::Subclassing
and then the three major layers over Pod::Simple:
Pod::Simple::Methody
Pod::Simple::PullParser
Pod::Simple::SimpleTree
which gives you method callbacks, a token stream, and a tree respectively.
I have to admit that when converting Pod::Man and Pod::Text, I ended up
writing my own layer to call into the structure that I was already using
with Pod::Parser. A similar approach may work for you since you're coming
from a Pod::Parser world. Take a look at the code that starts here:
https://github.com/rra/podlators/blob/master/lib/Pod/Text.pm#L149
It's fairly short.
> Second question: How do you retrieve the line number in the original
> text in your parsers? Will I have the same issue with the reported
> line numbers ignoring the cut parts of the file?
It depends on the interface that you use, but in general you'll get a
reference to an attrs hash passed into your code, and the start_line
element of that hash is the line number. I suspect the line numbers will
be more accurate, although I haven't tested this myself.
> Third question: Is it possible to get some information from the external
> blocks? (the parts that are not POD in the file) I would like to "see"
> the comments added to these parts, searching for specific comments that
> are intended for the translators. This is to implement something similar
> to --add-command of xgettext.
Yes, call the code_handler() method and pass it a callback. That callback
will be called for each non-POD block in the source file, and can then do
what it wants with them.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
----- End forwarded message -----
--
Reject: The reference on the SimGrid toolkit is outdated.
-- Bastard Reviewer From Hell
4 years, 5 months
Fwd: Re: Example of dumper (along with references) using Pod::Simple?
by Martin Quinson
These interesting mails got blocked because their authors are not
subscribed here. Thus the forward.
Mt.
----- Forwarded message from James E Keenan <jkeenan(a)pobox.com> -----
Date: Mon, 25 May 2020 10:53:26 -0400
From: James E Keenan <jkeenan(a)pobox.com>
To: pod-people(a)perl.org, Martin Quinson <martin.quinson(a)ens-rennes.fr>
Subject: Re: Example of dumper (along with references) using Pod::Simple?
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0
On 5/21/20 11:45 AM, Martin Quinson wrote:
> Hello,
>
> I'm one of the authors of the https://po4a.org/ tool, which eases the
> translation of documentation in various formats. The idea is to parse
> the documentations, keep the structure and replace the content in
> english with the translated content. See
> https://po4a.org/man/man1/po4a.1.php for more information.
>
> (beware, the mailing lists of both projects are CCed)
>
>
> po4a is written in Perl, and uses Pod::Parser so far, but I'm
> considering switching to Pod::Simple instead, thus this email.
>
> I seem to understand that Pod::Parser is kinda deprecated and
> Pod::Simple superior (I guess you agree?). In addition, my biggest
> concern with Pod::Parser is that the reported line numbers are wrong.
> The library reports fancyful locations for the blocks it reports.
> For example, the following page reports that the presented page is in
> file po4a, line 2 (there is a link to the bottom right).
> https://hosted.weblate.org/translate/po4a/po4a-doc/en/?checksum=439ba747a...
> But when you click on that link, you see that it's not the right
> location at all. That's line 2 of the POD chunks, not of the whole file.
>
> I had a look at Pod::Simple to see how to convert po4a to the
> modernity, but I would appreciate to have some guidance, please. For
> reference, our code is here:
> https://github.com/mquinson/po4a/blob/master/lib/Locale/Po4a/Pod.pm
I forked and cloned this repo, then ran 'perl ./Build.PL'. I was informed:
#####
hecking prerequisites...
test_requires:
! SGMLS is not installed
recommends:
* Locale::gettext is not installed
* SGMLS is not installed
* Text::WrapI18N is not installed
#####
I installed Locale::gettext and Text::WrapI18N without incident. I then
installed the Debian/Ubuntu package 'libsgmls-perl' in the hope that that
would satisfy the SGMLS pre-requisite. It did not. Moreover, './Build
installdeps' told me:
#####
Skipping SGMLS because I couldn't find a matching namespace.
#####
How should I proceed?
>
> For now, we override initialize(), command(), verbatim() and
> textblock() and then call parse_from_file() on the provided file.
>
> First question: which of the many Pod::Simple examples should I look
> at to adapt this code? Sorry for this silly question, but you really
> have many examples...
>
> Second question: How do you retrieve the line number in the original
> text in your parsers? Will I have the same issue with the reported
> line numbers ignoring the cut parts of the file?
>
> Third question: Is it possible to get some information from the
> external blocks? (the parts that are not POD in the file) I would like
> to "see" the comments added to these parts, searching for specific
> comments that are intended for the translators. This is to implement
> something similar to --add-command of xgettext.
>
>
> Summarizing the first questions, I'm looking for a Pod::Simple example
> that would dump the content to stdout along with the line numbers at
> which the blocks are found.
>
> And if you feel that I'm off tracks and that my questions are not
> relevant, I really need your guidance...
>
> Thanks in advance,
> Mt.
>
Thank you very much.
Jim Keenan
----- End forwarded message -----
--
Autrefois, c'était l'excellence qui faisait la notoriété.
Maintenant, c'est la notoriété qui fait l'excellence.
--- Alain Finkielkraut
4 years, 5 months
Example of dumper (along with references) using Pod::Simple?
by Martin Quinson
Hello,
I'm one of the authors of the https://po4a.org/ tool, which eases the
translation of documentation in various formats. The idea is to parse
the documentations, keep the structure and replace the content in
english with the translated content. See
https://po4a.org/man/man1/po4a.1.php for more information.
(beware, the mailing lists of both projects are CCed)
po4a is written in Perl, and uses Pod::Parser so far, but I'm
considering switching to Pod::Simple instead, thus this email.
I seem to understand that Pod::Parser is kinda deprecated and
Pod::Simple superior (I guess you agree?). In addition, my biggest
concern with Pod::Parser is that the reported line numbers are wrong.
The library reports fancyful locations for the blocks it reports.
For example, the following page reports that the presented page is in
file po4a, line 2 (there is a link to the bottom right).
https://hosted.weblate.org/translate/po4a/po4a-doc/en/?checksum=439ba747a...
But when you click on that link, you see that it's not the right
location at all. That's line 2 of the POD chunks, not of the whole file.
I had a look at Pod::Simple to see how to convert po4a to the
modernity, but I would appreciate to have some guidance, please. For
reference, our code is here:
https://github.com/mquinson/po4a/blob/master/lib/Locale/Po4a/Pod.pm
For now, we override initialize(), command(), verbatim() and
textblock() and then call parse_from_file() on the provided file.
First question: which of the many Pod::Simple examples should I look
at to adapt this code? Sorry for this silly question, but you really
have many examples...
Second question: How do you retrieve the line number in the original
text in your parsers? Will I have the same issue with the reported
line numbers ignoring the cut parts of the file?
Third question: Is it possible to get some information from the
external blocks? (the parts that are not POD in the file) I would like
to "see" the comments added to these parts, searching for specific
comments that are intended for the translators. This is to implement
something similar to --add-command of xgettext.
Summarizing the first questions, I'm looking for a Pod::Simple example
that would dump the content to stdout along with the line numbers at
which the blocks are found.
And if you feel that I'm off tracks and that my questions are not
relevant, I really need your guidance...
Thanks in advance,
Mt.
--
Never trust a programmer in a suit.
4 years, 5 months
Preventing formatting errors in the translation
by Martin Quinson
Hello,
I start this thread to move the discussion away from
https://github.com/mquinson/po4a/issues/239 (now closed)
First some context from the logs, and my latest answer below.
----------[ Me: ]----------
I agree that we cannot (and should not) try to enforce any kind of
conformance to whatever. If the input is broken and the translated doc
is equally broken (as much as the input, preferably not more than the
input), that's perfectly fine. po4a is not an asciidoc linter. That's
not our purpose.
What I mean is that po4a should use defensive programming and be
cautious about its input. The difficulty is that po4a is a technical
attempt to solve a social issue, ie the collaboration between doc
writers, translators, and end users that don't speak English.
If po4a is too picky about the input format, doc writers will
disregard po4a's error messages, which is never good. Same if the
error messages are not specific enough, and that's why I like very
much the compat new option. It gives us the ability to produce highly
specialized feedback.
But if it produces invalid translated files, the whole l10n process
will be disabled from the build chain. So there is another source of
concern: po4a should try to prevent the translators from introducing
formatting errors. This is why po4a introduces the markdown-text tag,
so that we can benefit from the weblate checks that are specific to
that language (patches to integrate them [partially] into po4a
directly would be gladly accepted). For the groff plugin (man pages),
similar checks are integrated into po4a directly.
I don't think we have any check of the translation in asciidoc. #242
is somewhat related to this problem, but not completely.
----------[ Jean-Noël: ]----------
That is another story and I fully agree with you, from experience.
Even when segmentation has been done to free translators from
block-level markup errors, we still face a risk that inline markup be
upset by translators, such as styles and anchors. To be able to
interact with professional translators, we had to add some rules in
their translation framework in order to correctly tag, preserve and
check inline formattings. IMAO, this is clearly a missing feature of
po oriented tools that do not provide such customizations the way they
provide checks for c-style place-holders and so on.
Maybe po4a could provide some sanity check on this, such as check that
links are correctly preserved. Right now, I can perform the check
after generation of an html file (using
https://github.com/gjtorikian/html-proofer), this is still a late and
loose check.
----------[ (end of logs) ]----------
These kind of consideration is to be implemented in each and every
po4a module. For example, the XML module implements placeholders, that
are replaced by a specific tag in the msgid where they were found, and
translated separately. Docbook XML is using them quite heavily. But I
don't think they are tested in our testsuite :(
Even if this feature would be implemented in the asciidoc module, we
would still have to check that the translator did not break the
placeholder :(
Mt
--
You can't solve social problems with software. -- Marcus Ranum's Law
4 years, 5 months