mquinson / po4a

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

Failed to run 'po4a-gettextize' for 'sgml' format (Error while running onsgmls -p) #489

Closed hwhsu1231 closed 1 month ago

hwhsu1231 commented 3 months ago

Problem Description

Recently, I tried to use po4a-gettextize to generate po files for SGML of PostgresSQL, but failed with the following error messages:

hwhsu1231@vb-kubuntu:~/Repo/testing/postgres/doc/src/sgml$ po4a-gettextize -f sgml -m xtypes.sgml -p xtypes.po
onsgmls:/tmp/po4a-5Oq6.sgml:3:1:E: prolog can't be omitted unless CONCUR NO and LINK EXPLICIT NO and either IMPLYDEF ELEMENT YES or IMPLYDEF DOCTYPE YES
onsgmls:/tmp/po4a-5Oq6.sgml:3:1:E: no document type declaration; will parse without validation
po4a::sgml: Error while running onsgmls -p.  Please check if onsgmls and the DTD are installed.
hwhsu1231@vb-kubuntu:~/Repo/testing/postgres/doc/src/sgml$

What happened?

Version and Platform

Fat-Zer commented 3 months ago

There are two problems:

  1. For sgml you should specify only the root document, rather than those it includes, for postgres it should be postges.sgml.
  2. Despite the extensions, the files seems to be in xml docbook format (as the Makefiles use xsltproc to process them) rather than actual sgml. So you'd have better luck using docbook module:

    po4a-gettextize -f docbook -m xtypes.sgml -p xtypes.po

PS: You're using quite old version of po4a, so I'm not sure how things were back then, but nowadays you should use po4a-updatepo to generate pot-files rather than po4a-gettextize, or even better the unified po4a utility.

mquinson commented 1 month ago

I'm closing this issue because @Fat-Zer provided an explanation to the initial answer. Thanks for that.

@hwhsu1231 do not hesitate to reopen this bug with additional information if this does not solve the problem for you.