[Po4a-devel] Fwd: formatting issues (asciidoc backend).

D. Barbier bouzim at gmail.com
Sun Jan 11 23:40:11 UTC 2015


[Fowarded message from Didier who is has trouble sending mails to po4a-devel]

Hi,

__Issue #1:

po4a-translate -f asciidoc -m $PAGE_SOURCE -k 70 -p $TRANSLATION_PO -l
$TRANSLATION_TXT -M UTF-8 -L UTF-8

wrap lines in $TRANSLATION_TEXT, regardless of the -w setting.

Example:

in $PAGE_SOURCE:

Le site http://slackware.com[slackware.com] est un point d'entrée vers
les ressources suivantes :

* https://store.slackware.com/cgi-bin/store[La boutique] pour soutenir
financièrement Slackware
* des http://mirrors.slackware.com/slackware/slackware-iso/[images ISO],
une http://mirrors.slackware.com/[liste de miroirs], des
http://www.slackware.com/getslack/torrents.php[torrents] pour obtenir la
distribution,
* http://mirrors.slackware.com/slackware/[les arbres des fichiers]
depuis la version 1.01
* Le http://packages.slackware.com/[navigateur de paquets] permet une
recherche de paquets pour toutes les versions depuis Slackware 8.1

in $TRANSLATION_TXT:

The website http://slackware.com[slackware.com] is an entry point to the
following resources:

* https://store.slackware.com/cgi-bin/store[The store] to financially
  Slackware,
* http://mirrors.slackware.com/slackware/slackware-iso/[ISO images], a
  http://mirrors.slackware.com/[mirrors list],
  http://www.slackware.com/getslack/torrents.php[torrents] to get the
  distribution,
* http://mirrors.slackware.com/slackware/[Files trees] from version 1.01,
* The http://packages.slackware.com/[Packages browser] allows to find
packages
  for all versions since Slackware 8.1

In $TRANSLATION_PO lines are not wrapped.

This doesn't hurt when using the translation as an input of an asciidoc
command, but I began writing a sed script top convert an asciidoc file
to a dokuwki one and wrapping a line that begin with "* " breaks the
dokuwiki layout.

I added a sed snippet to correct that but would prefer that
po4a-translate don't wrap lines unless set to.

__Issue #2:

Running this:

po4a-gettextize -f asciidoc -m $SRC -M UTF-8 \
-p $POT \
--package-name="$PAGE" --package-version="unknown" \
--copyright-holder "The Slint project"

__applied to $SRC:

Elle est constituée de fichiers textes dans le répertoire /var/log du
système installé :

/var/log/packages/<paquet> : fournit les données de synthèse sur le
paquet et liste les fichiers installés +
/var/log/scripts/<paquet> : liste le cas échéant les commandes exécutées
par les scripts d'installation +
/var/log/removed_packages/<paquet> : fournit les informations sur les
paquets supprimés +
/var/log/removed_scripts/<paquet> : liste les commandes exécutées par
les scripts d'installation des paquets supprimés

__gives this $POT

#. type: Plain text
#: /home/didier/Slint/articles/asciidoc/newcomers.fr.txt:155
msgid ""
"Elle est constituée de fichiers textes dans le répertoire /var/log du "
"système installé :"
msgstr ""

#. type: Plain text
#: /home/didier/Slint/articles/asciidoc/newcomers.fr.txt:160
msgid ""
"/var/log/packages/<paquet> : fournit les données de synthèse sur le
paquet "
"et liste les fichiers installés + /var/log/scripts/<paquet> : liste le
cas "
"échéant les commandes exécutées par les scripts d'installation + "
"/var/log/removed_packages/<paquet> : fournit les informations sur les "
"paquets supprimés + /var/log/removed_scripts/<paquet> : liste les
commandes "
"exécutées par les scripts d'installation des paquets supprimés"
msgstr ""

So there is no \n after the lines that end in " +"

This is more annoying than issue #1, because I don't know a safe way to
post-process the file with sed. The asciidoc manual says:
>
> A plus character preceded by at least one space character at the end
> of a non-blank line forces a line break. It generates a line break
> (br) tag for HTML outputs and a custom XML asciidoc-br processing
> instruction for DocBook outputs. The asciidoc-br processing instruction
> is handled by a2x(1).


Of course I can cut the lines after ' +", but there care cases like
"3 + 2 = 5" where I shouldn't.

Unfortunately my complete lack of perl knowledge prevents me to propose
a patch to close these issues:(

PS More generally, would it be possible that the presence of \n in the
source asciidoc text file be preserved in every case in the POT file
(after po4a-gettextize) then in the translated asckidoc text files (after
po4a-translate)? The goal being that the translated asciidoc text file
matches the source asciidoc text file line per line (Preferably keeping
the ability for the translator to insert \n in the translation, provided
it be not at the boundary of a message. In that case of course the
translated text won't match the source test line per line);

Cheers, Didier



More information about the Po4a-devel mailing list