mquinson / po4a

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

docbook: Multiline entities not translated #488

Open roptat opened 8 months ago

roptat commented 8 months ago

I'm working with a docbook file that I want to translate. The authors added a few entity definitions at the top, and they can be translated thanks to po4a. However, one of them is on multiple lines, and po4a doesn't generate an entry for it in the po file:

  <!ENTITY openssh-size          "1.7 MB">
  <!ENTITY openssh-buildsize     "45 MB (add 22 MB for tests)">
  <!ENTITY openssh-time          "0.2 SBU (Using parallelism=4;
                                  running the tests takes about 20 minutes,
                                  irrespective of processor speed)">

po4a provides translation for the first two, but not the last one.

Fat-Zer commented 8 months ago

For clarity, is it XML or SGML docbook?

Fat-Zer commented 8 months ago

Assuming the docbook is XML, it's a known limitation of the po4a's XML parser, see TODO list in man Locale::Po4a::Xml.

po4a parses XMLs with regexps, so it will be not trivial to do it right...

mquinson commented 6 months ago

In the meanwhile, the best is to put your entities on single lines, please.

osamuaoki commented 2 weeks ago

I may be wrong but ...

If it is non-trivial to single-line these SGML entities, put them in a separate file and include them with single-line.

<!ENTITY % commondata     SYSTEM "common.ent"      > %commondata;

Just an idea ...