mquinson / po4a

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

po4-translate doesn't preserve the spaces under some circumstances #122

Closed jorgesumle closed 6 years ago

jorgesumle commented 6 years ago

When we translate with po4a-translate -f texinfo -m ./bashref.texi -p ./bashref.es.po -l ./bashref.es.texi on long lines from @menu some words lose the separation space they had in the PO file. We're using po4a-translate Version 0.47. You can find more info on our issue tracker.

The following...

msgid ""
"How to compile Bash for more than one kind of system from the same source tree."
msgstr ""
"C@'omo compilar Bash para m@'as de un tipo de sistema desde el mismo @'arbol de "
"fuentes."

produces (see that @'arbolde, it should be @'arbol de)...

* Compilando para M@'ultiples Arquitecturas::  C@'omo compilar Bash para 
                                                 m@'as de un tipo de sistema 
                                                 desde el mismo @'arbolde 
                                                 fuentes.

We are using GNU Texinfo for the documentation, the problem only appears on @menu sections.

mquinson commented 6 years ago

Hello,

could you please produce a minimal working example to simplify the reproduction of thsi problem, please? In other words, it would really ease things if I had a small input file reproducing the problem. I'd add it to the test suite, and fix the bug.

Thanks in advance, Mt

jorgesumle commented 6 years ago

Texinfo file (testinfo.texi)

\input texinfo

@menu
* Compiling For Multiple Architectures::    How to compile Bash for more
                        than one kind of system from
                        the same source tree.
@end menu

@node Compiling For Multiple Architectures
@chapter Compiling For Multiple Architectures

Steps to reproduce

  1. po4a-gettextize -f texinfo -m testinfo.texi -p testinfo.pot
  2. Translate POT file...

PO translation (es.po)

# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2018-05-30 10:14+0200\n"
"PO-Revision-Date: 2018-05-30 10:14+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. type: chapter
#: testinfo.texi:7 testinfo.texi:9 testinfo.texi:10
#, no-wrap
msgid "Compiling For Multiple Architectures"
msgstr "Compilar para M@'ultiples Arquitecturas"

#. type: menuentry
#: testinfo.texi:7
msgid ""
"How to compile Bash for more than one kind of system from the same source "
"tree."
msgstr ""
"C@'omo compilar Bash para m@'as de un tipo de sistema desde el mismo @'arbol "
"de fuentes."
  1. Generate translated Texi file with po4a-translate -k 1 -f texinfo -m testinfo.texi -p es.po -l testinfo.es.texi. I get the following result...
\input texinfo
@c ===========================================================================
@c
@c This file was generated with po4a. Translate the source file.
@c
@c ===========================================================================

@menu
* Compilar para M@'ultiples Arquitecturas::  C@'omo compilar Bash para m@'as 
                                               de un tipo de sistema desde el 
                                               mismo @'arbolde fuentes.
@end menu

@node Compilar para M@'ultiples Arquitecturas
@chapter Compilar para M@'ultiples Arquitecturas
mquinson commented 6 years ago

Thanks for this example. I am surprised that you need to write @' in the po file too. Wouldn't you think that this kind of things should be automatically handled by po4a? I mean, that the translators should be asked to write ' only, and po4a would write @' in the texinfo file.

Sorry, I know it's not the topic. I'll fix the bug anyway, but I'm surprised...

jorgesumle commented 6 years ago

Thanks for this example. I am surprised that you need to write @' in the po file too. Wouldn't you think that this kind of things should be automatically handled by po4a? I mean, that the translators should be asked to write ' only, and po4a would write @' in the texinfo file.

Yes, it's not very convenient, I actually used sed after the translation so it wasn't a big deal, but it would be nice if po4a would do that for me.