XML::TMX::Reader(3pm) | User Contributed Perl Documentation | XML::TMX::Reader(3pm) |
XML::TMX::Reader - Perl extension for reading TMX files
version 0.39
use XML::TMX::Reader; my $reader = XML::TMX::Reader->new( $filename ); $reader -> for_tu( sub { my $tu = shift; #blah blah blah }); @used_languages = $reader->languages; $reader->to_html()
This module provides a simple way for reading TMX files.
The following methods are available:
This method creates a new XML::TMX::Reader object. This process checks for the existence of the file and extracts some meta-information from the TMX header;
my $reader = XML::TMX::Reader->new("my.tmx");
This method is used to set the flag to ignore (or not) markup inside translation unit segments. The default is to ignore those markup.
If called without parameters, it sets the flag to ignore the markup. If you don't want to do that, use
$reader->ignore_markup(0);
This method returns the languages being used on the specified translation memory. Note that the module does not check for language code correctness or existence.
Use "for_tu" to process all translation units from a TMX file. This version iterates for all tu (one at the time)
The configuration hash is a reference to a Perl hash. At the moment these are valid options:
The function will receive two arguments:
the language codes to the respective translation unit segment;
a special key "-prop" that maps property names to properties;
a special key "-note" that maps to a list of notes.
If you want to process the TMX and return it again, your function should return an hash reference where keys are the languages, and values their respective translation.
Use this method to create a nice HTML file with the translation memories. Notice that this method is not finished yet, and relies on some images, on some specific locations.
deprecated. use "for_tu"
XML::Writer(3), TMX Specification <https://www.gala-global.org/oscarStandards/tmx/tmx14b.html>
Paulo Jorge Jesus Silva, <paulojjs@bragatel.pt>
This software is copyright (c) 2010-2017 by Projeto Natura <natura@di.uminho.pt>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
2022-07-11 | perl v5.34.0 |