|
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
|
|
907.
|
|
|
The found string is the content of a translatable tag. The entry "tag_options" contains the option characters in front of the tag hierarchy in the module "tags" option.
|
|
|
type: textblock
|
|
|
|
La cadena encontrada es el contenido de una etiqueta traducible. La entrada «tag_options» (opciones de etiquetas) contiene los caracteres de opciones delante de la jerarquía de etiquetas en la opción «tags» del módulo.
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: textblock
|
|
Located in
lib/Locale/Po4a/Xml.pm:600
|
|
908.
|
|
|
type="attribute"
|
|
|
type: =item
|
|
|
|
type=«atributo»
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: =item
|
|
Located in
lib/Locale/Po4a/Xml.pm:604
|
|
909.
|
|
|
Means that the found string is the value of a translatable attribute. The entry "attribute" has the name of the attribute.
|
|
|
type: textblock
|
|
|
|
Significa que la cadena encontrada es el valor de un atributo traducible. La entrada «atributo» contiene el nombre del atributo.
|
|
Translated by
Omar Campagne
|
|
|
|
|
type: textblock
|
|
Located in
lib/Locale/Po4a/Xml.pm:606
|