|
897.
|
|
|
Space-separated list of the tags you want to translate or not. The tags must be in the form <aaa>, but you can join some (<bbb><aaa>) to indicate that the content of the tag <aaa> will only be translated when it’s into a <bbb> tag.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
lib/Locale/Po4a/Xml.pm:311
|
|
898.
|
|
|
You can also specify some tag options putting some characters in front of the tag hierarchy. For example, you can put ’w’ (wrap) or ’W’ (don’t wrap) to overide the default behavior specified by the global "wrap" option.
|
|
|
|
(no translation yet)
|
|
|
|
899.
|
|
|
DEFINE WHAT TAGS AND ATTRIBUTES TO TRANSLATE
|
|
|
type: =head2
|
|
|
|
DEFINIR QUÉ ETIQUETAS Y ATRIBUTOS TRADUCIR
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: =head2
|
|
Located in
lib/Locale/Po4a/Xml.pm:560
|
|
900.
|
|
|
The simplest customization is to define which tags and attributes you want the parser to translate. This should be done in the initialize function. First you should call the main initialize, to get the command-line options, and then, append your custom definitions to the options hash. If you want to treat some new options from command line, you should define them before calling the main initialize:
|
|
|
type: textblock
|
|
|
|
La personalización más simple es definir qué etiquetas («tags») y atributos quiere que el analizador traduzca. Esto se debe hacer en la función initialize. Primero debe invocar la inicialización principal, para obtener las opciones de la línea de órdenes, y luego, añadir sus definiciones personalizadas a la tabla hash de opciones. Si quiere tratar nuevas opciones de la línea de órdenes, debe definirlas antes de llamar a la función initialize principal:
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: textblock
|
|
Located in
lib/Locale/Po4a/Xml.pm:562
|
|
901.
|
|
|
$self->{options}{'new_option'}='';
$self->SUPER::initialize(%options);
$self->{options}{'tags'}.=' <p> <head><title>';
$self->{options}{'attributes'}.=' <p>lang id';
$self->{options}{'inline'}.=' <br>';
$self->treat_options;
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
represents a space character.
Enter a space in the equivalent position in the translation.
|
|
|
|
$self->{options}{'nueva_opcion'}='';
$self->SUPER::initialize(%options);
$self->{options}{'tags'}.=' <p> <head><title>';
$self->{options}{'attributes'}.=' <p>lang id';
$self->{options}{'inline'}.=' <br>';
$self->treat_options;
|
|
Translated by
Jordi Vilalta Prat
|
|
|
|
|
type: verbatim
|
|
Located in
lib/Locale/Po4a/Xml.pm:394
|
|
902.
|
|
|
OVERRIDING THE found_string FUNCTION
|
|
|
type: =head2
|
|
|
|
REDEFINIR LA FUNCIÓN found_string
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: =head2
|
|
Located in
lib/Locale/Po4a/Xml.pm:582
|
|
903.
|
|
|
Another simple step is to override the function "found_string", which receives the extracted strings from the parser, in order to translate them. There you can control which strings you want to translate, and perform transformations to them before or after the translation itself.
|
|
|
type: textblock
|
|
|
|
Otro paso simple es redefinir la función «found_string», que recibe las cadenas extraídas por el analizador para su traducción. Ahí puede controlar qué cadenas quiere traducir, y realizar pequeñas transformaciones antes o después de la traducción misma.
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: textblock
|
|
Located in
lib/Locale/Po4a/Xml.pm:584
|
|
904.
|
|
|
It receives the extracted text, the reference on where it was, and a hash that contains extra information to control what strings to translate, how to translate them and to generate the comment.
|
|
|
type: textblock
|
|
|
|
Recibe el texto extraído, la referencia de dónde está, y una tabla hash que contiene información adicional para controlar qué cadenas traducir, cómo traducirlas y generar el comentario.
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: textblock
|
|
Located in
lib/Locale/Po4a/Xml.pm:589
|
|
905.
|
|
|
The content of these options depends on the kind of string it is (specified in an entry of this hash):
|
|
|
type: textblock
|
|
|
|
El contenido de las opciones depende del tipo de cadena que sea (especificado en una entrada de este hash):
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: textblock
|
|
Located in
lib/Locale/Po4a/Xml.pm:593
|
|
906.
|
|
|
type="tag"
|
|
|
type: =item
|
|
|
|
type=«etiqueta»
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: =item
|
|
Located in
lib/Locale/Po4a/Xml.pm:598
|