po4av0.70

Locale::Po4a::Sgml

Section: Po4a Tools (3pm)
Updated: 2024-01-29
Index Return to Main Contents
 

NOM

Locale::Po4a::Sgml - Converteix documents SGML des de/a fitxers PO  

DESCRIPCIÓ

L'objectiu del projecte po4a (PO per a tot) és facilitar la traducció (i sobretot el manteniment de les traduccions) utilitzant les eines de gettext en àrees on no eren d'esperar, com ara en la documentació.

Locale::Po4a::SgmL és un mòdul per ajudar en la traducció de documents en el format SGML a altres llenguatges [humans].

This module uses onsgmls(1) to parse the SGML files. Make sure it is installed. Also make sure that the DTD of the SGML files are installed in the system.  

OPCIONS QUE ACCEPTA AQUEST MÒDUL

debug
Llista separada per espais de les paraules clau que indiquen quina part voleu depurar. Els valors possibles són: tag, generic, entities i refs.
verbose
Dóna més informació sobre què està passant.
translate
Llista separada per espais dels tags extra (a part dels que proveeix el DTD) el contingut dels quals ha de formar un msgid extra.
section
Llista separada per espais dels tags extra (a part dels que proveeix el DTD) que contenen altres tags, alguns dels quals poden ser de la categoria translate.
indent
Space separated list of tags which increase the indentation level.
verbatim
La disposició dins d'aquests tags no s'ha de canviar. El paràgraf no es justificarà, i no s'afegiran espais d'indentació ni noves línies amb propòsits cosmètics.
empty
Tags que no necessiten tancament.
ignore
Tags ignored and considered as plain char data by po4a. That is to say that they can be part of an msgid. For example, <b> is a good candidate for this category since putting it in the translate section would create msgids not being whole sentences, which is bad.
attributes
A space separated list of attributes that need to be translated. You can specify the attributes by their name (for example, ``lang''), but you can also prefix it with a tag hierarchy, to specify that this attribute will only be translated when it is into the specified tag. For example: <bbb><aaa>lang specifies that the lang attribute will only be translated if it is in an <aaa> tag, which is in a <bbb> tag. The tag names are actually regular expressions so you can also write things like <aaa|bbbb>lang to only translate lang attributes that are in an <aaa> or a <bbb> tag.
qualify
A space separated list of attributes for which the translation must be qualified by the attribute name. Note that this setting automatically adds the given attribute into the 'attributes' list too.
force
Proceed even if the DTD is unknown or if onsgmls finds errors in the input file.
include-all
Per defecte, per la comoditat del traductor, se salten els msgids que contenen només una entitat (com ara '&version;'). Si no es vol aquesta optimització, es pot activar aquesta opció. Pot ser útil si el document conté construccions com ara ``<title>&Aacute;</title>'', encara que dubto que mai passin coses així...
ignore-inclusion
Space separated list of entities that won't be inlined. Use this option with caution: it may cause onsgmls (used internally) to add tags and render the output document invalid.
 

ESTAT D'AQUEST MÒDUL

The result is perfect. I.e., the generated documents are exactly the same. But there are still some problems:
The error output of onsgmls is redirected to /dev/null by default, which is clearly bad. I don't know how to avoid that.

The problem is that I have to ``protect'' the conditional inclusions (i.e. the "<! [ %foo [" and "]]>" stuff) from onsgmls. Otherwise onsgmls eats them, and I don't know how to restore them in the final document. To prevent that, I rewrite them to "{PO4A-beg-foo}" and "{PO4A-end}".

The problem with this is that the "{PO4A-end}" and such I add are invalid in the document (not in a <p> tag or so).

If you want to view the onsgmls output, just add the following to your command line (or po4a configuration line):

  -o debug=onsgmls

Només funciona amb els dtds de DebianDoc i DocBook DTD. Hauria de ser molt fàcil afegir suport per a un nou DTD. El mecanisme és el mateix per a tots els DTD, tan sols heu de donar una llista dels tags existents i algunes de les seves característiques.

Estic d'acord, això s'ha de documentar millor, però encara es considera beta, i odio documentar coses que poden/han de canviar.

Atenció, el suport de DTDs encara és força experimental. No he llegit cap manual de referència per trobar la definició de tots els tags. Només he afegit la definició de tags al mòdul fins que ha funcionat per alguns documents que he trobat a la xarxa. Si el vostre document utilitza més tags que el meu, no funcionarà. Però com he dit abans, hauria de ser molt fàcil d'arreglar.

Només he provat DocBook amb SAG (Guia d'Administrador de Sistemes, System Administrator Guide), però és un document força gran, i hauria d'utilitzar la majoria de característiques de DocBook.

Per DebianDoc, he provat amb alguns manuals del DDP, però no tots encara.

En cas d'inclusió de fitxers, la cadena de referència del fitxer PO (és a dir, línies com ara "#: en/titletoc.sgml:9460") serà errònia.

This is because I preprocess the file to protect the conditional inclusion (i.e. the "<! [ %foo [" and "]]>" stuff) and some entities (like &version;) from onsgmls because I want them verbatim to the generated document. For that, I make a temp copy of the input file and do all the changes I want to this before passing it to onsgmls for parsing.

So that it works, I replace the entities asking for a file inclusion by the content of the given file (so that I can protect what needs to be in a subfile also). But nothing is done so far to correct the references (i.e., filename and line number) afterward. I'm not sure what the best thing to do is.

 

AUTORS

This module is an adapted version of sgmlspl (SGML postprocessor for the ONSGMLS parser) which was:

 Copyright © 1995 David Megginson <dmeggins@aix1.uottawa.ca>

L'adaptació per po4a ha estat feta per:

 Denis Barbier <barbier@linuxfr.org>
 Martin Quinson (mquinson#debian.org)

 

TRADUCCIÓ

 Carme Cirera <menxu@hotmail.com>
 Jordi Vilalta <jvprat@gmail.com>

 

DRET DE CÒPIA I LLICÈNCIA

 Copyright © 1995 David Megginson <dmeggins@aix1.uottawa.ca>.
 Copyright © 2002-2005 SPI, Inc.

This program is free software; you may redistribute it and/or modify it under the terms of GPL v2.0 or later (see the COPYING file).


 

Index

NOM
DESCRIPCIÓ
OPCIONS QUE ACCEPTA AQUEST MÒDUL
ESTAT D'AQUEST MÒDUL
AUTORS
TRADUCCIÓ
DRET DE CÒPIA I LLICÈNCIA

This document was created by using the manual pages.
Time: 00:28:40 GMT, January 29, 2024
català Deutsch English Esperanto español français hrvatski Magyar Italiano 日本語 Bokmål Nederlands polski Português Português (Brasil) Русский српски језик український 简体中文 简体中文 (how to set the default document language)