New --porefs option, call to translations coming soon, po4a-buid retired
by D. Barbier
Hello,
In a project I am translating into French, I recently discovered that
developers use
po4a-gettextize -o porefs=none ...
to generate PO files without line numbers in references. The
advantage is that POT file is not modified when line numbers change.
Of course, the drawback is that we are losing some information. For
instance, po4aman-display-po could not work on such PO files (and I
really like this tool).
The -o flag above means that porefs is an option of the
Locale::Po4a::Po module. In the last days, I made some commits to also
add a --porefs option to po4a, so that this option is available when
using po4a with a configuration file (instead of calling
po4a-gettextize, po4a-updatepo and po4a-translate).
It works great, I also just added another option --porefs=counter to
not break po4aman-display-po ;)
I will soon update PO files so that you can translate documentation
about these new options. But I want to build PO files with
--porefs=counter. The problem is that I do not know how to do that
with the current build system. So unless someone explains how to do
that with po4a-build, I will very soon revert our build system to
using plain configuration files.
Denis
12 years, 1 month
parsing asciidoc styles
by Anders Nawroth
Hi!
I found a problem with the parsing of AsciiDoc "styles", or rather,
they are simply not parsed.
Here's an example.
In the original file we have:
[appendix]
Questions & Answers
===================
The po file generated by po4a-gettextize looks like this:
#. type: Plain text
#: target/original/src/qanda/index.asciidoc:4
msgid "[appendix] Questions & Answers"
msgstr "[appendix] Questions & Réponses"
And thus the following get generated when translating:
[appendix] Questions & Réponses
===================
So, "[appendix]" is something called a style in AsciiDoc.
There exists a few predefined styles and you can add your own as well.
The AsciiDoc filters are defined as styles.
I was only going to report this, but after having a look at the newly
refactored (thanks!)
Text.pm I changed my mind and fixed it instead :-)
Here's the essential part of the diff:
- ($line =~
m/^\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION|verse|quote)\]$/)) {
+ ($line =~
m/^\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION|verse|quote|appendix|horizontal|qanda|glossary|bibliography|listing|abstract|partintro|literal|float|normal|comment|example|sidebar|source|music|latex|graphviz|arabic|loweralpha|upperalpha|lowerroman|upperroman)\]$/))
{
I went through the AsciiDoc user guide and added all the styles I
could find in it.
Didn't look into the AsciiDoc sources, though.
A slightly related problem which I didn't fix:
When applying a filter and having attributes/parameters for it, that
line is parsed as plain text.
it should be no-wrap really, I think.
Example:
#. type: Plain text
#: target/original/src/introduction/what-is-a-graphdb.asciidoc:20
msgid "[\"dot\", \"graphdb-GVE.svg\", \"meta\"]"
msgstr "[\"dot\", \"graphdb-GVE.svg\", \"meta\"]"
(We have a bunch of our own AsciiDoc filters, obviously one is named "dot".)
I do think this message should get translated (as there may be
attributes in there that you wish to alter in a translation), but it's
not plain text.
/anders
--
Anders Nawroth [anders(a)neotechnology.com]
Skype: anders.nawroth
12 years, 1 month
error parsing document header
by Anders Nawroth
Hi!
I have the following two documents:
The original:
What is a Graph Database?
=========================
The translation:
Qu'est-ce qu'une base de données graphe?
========================================
Running po4a-gettextize on them gives:
po4a gettextization: Structure disparity between original and translated files:
msgid (at target/original/src/dummy.asciidoc:2) is of type 'Title =' while
msgstr (at src/dummy.asciidoc:2) is of type 'Plain text'.
Original text: What is a Graph Database?
Translated text: Qu'est-ce qu'une base de données graphe?
If I change the translation like this:
= Qu'est-ce qu'une base de données graphe? =
then everything is fine, and the following is generated:
#. type: Title =
#: target/original/src/dummy.asciidoc:2
#, fuzzy, no-wrap
msgid "What is a Graph Database?"
msgstr "Qu'est-ce qu'une base de données graphe?"
I won't try fixing this one, the workaround is ok for my use case so far.
And I'm not even sure where in the code to look for this one :-)
/anders
--
Anders Nawroth [anders(a)neotechnology.com]
Skype: anders.nawroth
12 years, 1 month
Creation of pot files from LaTeX files
by Carsten Gerlach
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello po4a dev team,
I have a question about po4a-gettextize and I hope I’m right here on
the dev list with my normal user question. :-)
I’m a member of the Ubuntu Manual team [1] and we use po4a for
managing the translation of the manual. We use XeLaTeX for writing the
manual and so we have to deal with some tex commands in the
translation pot file.
Ok, I have a small example document to illustrate my question:
======minimal.tex=============================================
\documentclass{article}
\newcommand{\mycommand}{foo bar}
\begin{document}
\tableofcontents
\section{Hello World!}
\mycommand
\end{document}
==============================================================
If I now use po4a-gettextize to create a pot file
$ po4a-gettextize -f latex -m minimal.tex -p minimal.pot
I get the following output
======minimal.pot=============================================
[... header of pot file]
#. type: newcommand{#4}
#: minimal.tex:7
msgid "foo bar"
msgstr ""
#. type: section{#2}
#: minimal.tex:7
msgid "Hello World!"
msgstr ""
#. type: document
#: minimal.tex:7
msgid "\\mycommand"
msgstr ""
==============================================================
I see, that all known LaTeX commands are ignored by po4a (like
\tableofcontents) and only the real content which need a translation
is there.
So, how can I teach po4a with my own commands which should be ignored
by po4a (like \mycommand)?
I found the definition file of all latex commands
(/usr/share/perl5/Locale/Po4a/LaTeX.pm) and I had a look to the man
page of po4a-gettextize. But I do not see a possibility to give my own
definition file to the po4a run like something like that:
$ po4a-gettextize -f latex -m minimal.tex -p minimal.pot
- -use_my_file_with_ignored_commands
I would be glad if you can show me how to make this or point me to the
paragraph in the documentation which I did not yet find.
Thanks in advance!
Greetings, Carsten
[1] http://ubuntu-manual.org/
- --
Hier ist mein öffentlicher GPG-Schlüssel:
http://daswaldhorn.piranho.de/gpg/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iEYEARECAAYFAlBguxUACgkQ6SlDN6cxaI4xSQCfT+eJe8/X3++32GDDBK7p7J8r
qkcAnA30FAnRvlc9eN2NCJbAhlkJ1QnY
=KHl4
-----END PGP SIGNATURE-----
12 years, 1 month
Length of messages
by Hannie Dumoleyn
Hi developers,
As a member of the Ubuntu Manual Project, http://ubuntu-manual.org/, I
have a question on how po4a splits text in separate messages.
Our manual can be translated on Launchpad, but the problem is that many
of the individual messages (msgid) are too long.
Here is an example of a long string:
https://translations.launchpad.net/ubuntu-manual/precise/+pots/ubuntu-man...
\advanced{A \acronym{MAC} address is a hardware address for your
computer's network card. Entering this information is sometimes
important when using a cable modem connection. If you know the
\acronym{MAC} address of your network card, this can be entered in the
appropriate text field in the \button{Wired} tab of the editing window.
To find the MAC addresses for all installed networking devices, open a
terminal window, and at the command line prompt, type
\userinput{ifconfig}. This will display a lot of information about each
of the network devices installed on the computer. The wired devices will
be labeled as \textfield{LAN0}, \textfield{LAN1}, etc. The wireless
devices will appear as \textfield{WLAN0}, \textfield{WLAN1}, etc.}
My question is this:
Is it possible to split text after every . (dot)?
Regards,
Hannie Dumoleyn
Member of The Ubuntu Manual Project
Member of Ubuntu Dutch Translators
12 years, 2 months
Major redesign of Locale::Po4a::Text, please test
by D. Barbier
Hello,
I just committed a change in Locale::Po4a::Text to split the huge
parse() method. The new version should be easier to maintain.
All tests pass and I had been careful to not introduce behavior
changes, but I do not use this module myself, so regressions may have
been introduced. If you use this module (with any of its flavour),
please test it before these changes are released.
Thanks,
Denis
12 years, 2 months
asciidoc table support
by Anders Nawroth
Hi!
I just found out about po4a recently, and it matches my use case very
well which is wonderful!
Anyhow, I'm having a problem with the AsciiDoc support.
It seems it simply doesn't parse table differently (marking them as Plain text).
Which of course ruins the markup completely (as it's rewrapped).
I tried fixing this by editing the Text.pm file, matching the table
markup in line 376
(of the current trunk version of the file), like so:
($line =~ m/^(\/{4,}|\+{4,}|-{4,}|\.{4,}|\*{4,}|_{4,}|={4,}|~{4,}|\|(=){4,})$/))
{
i.e., adding |\|(=){4,}
and then modifying the listing block code to make it handle tables as
well (line 398):
} elsif ($t eq "-" || $t eq "|") {
This makes po4a-gettextize output a po file that looks perfect to me.
The content of the table is recognized as a delimited block, set to no-wrap,
and the text has explicit \n's for the newlines.
The problem comes when running po4a-translate.
The table markup is still rewrapped in the result!
Can anybody give me a hint as to what I'm missing here?
I attached example data in a file.
/anders
--
Anders Nawroth [anders(a)neotechnology.com]
Skype: anders.nawroth
12 years, 2 months