| XML::TMX::Writer(3pm) | User Contributed Perl Documentation | XML::TMX::Writer(3pm) |
XML::TMX::Writer - Perl extension for writing TMX files
version 0.39
use XML::TMX::Writer;
my $tmx = XML::TMX::Writer->new();
$tmx->start_tmx(id => 'paulojjs');
$tmx->add_tu('en' => 'some text', 'pt' => 'algum texto');
$tmx->add_tu('en' => 'some text',
'pt' => 'algum texto',
-note => [32, 34 ],
-prop => { q => 23,
aut => "jj"}
);
$tmx->end_tmx();
This module provides a simple way for writing TMX files.
The following methods are available:
$tmx = new XML::TMX::Writer();
Creates a new XML::TMX::Writer object
$tmx->start_tmx(-output => 'some_file.tmx');
Begins a TMX file. Several options are available:
The recommended values for the datatype attribute are as follow (this list is not exhaustive):
$tmx->add_tu(srclang => LANG1, LANG1 => 'text1', LANG2 => 'text2');
$tmx->add_tu(srclang => LANG1,
LANG1 => 'text1',
LANG2 => 'text2',
-note => ["value1", ## notes
"value2"],
-prop => { type1 => ["value1","value"], #multiple values
_ => 'value2', # anonymound properties
typen => ["valuen"],}
);
Adds a translation unit to the TMX file. Several optional labels can be specified:
$tmx->end_tmx();
Ends the TMX file, closing file handles if necessary.
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 |