.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML::TMX::Writer 3pm" .TH XML::TMX::Writer 3pm 2024-03-09 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME XML::TMX::Writer \- Perl extension for writing TMX files .SH VERSION .IX Header "VERSION" version 0.39 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use XML::TMX::Writer; \& \& my $tmx = XML::TMX::Writer\->new(); \& \& $tmx\->start_tmx(id => \*(Aqpaulojjs\*(Aq); \& \& $tmx\->add_tu(\*(Aqen\*(Aq => \*(Aqsome text\*(Aq, \*(Aqpt\*(Aq => \*(Aqalgum texto\*(Aq); \& $tmx\->add_tu(\*(Aqen\*(Aq => \*(Aqsome text\*(Aq, \& \*(Aqpt\*(Aq => \*(Aqalgum texto\*(Aq, \& \-note => [32, 34 ], \& \-prop => { q => 23, \& aut => "jj"} \& ); \& \& $tmx\->end_tmx(); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides a simple way for writing TMX files. .SH METHODS .IX Header "METHODS" The following methods are available: .SS new .IX Subsection "new" .Vb 1 \& $tmx = new XML::TMX::Writer(); .Ve .PP Creates a new XML::TMX::Writer object .SS start_tmx .IX Subsection "start_tmx" .Vb 1 \& $tmx\->start_tmx(\-output => \*(Aqsome_file.tmx\*(Aq); .Ve .PP Begins a TMX file. Several options are available: .IP \-output 4 .IX Item "-output" Output of the TMX, if none is defined stdout is used by default. .IP tool 4 .IX Item "tool" Tool used to create the TMX. Defaults to 'XML::TMX::Writer' .IP toolversion 4 .IX Item "toolversion" Some version identification of the tool used to create the TMX. Defaults to the current module version .IP segtype 4 .IX Item "segtype" Segment type used in the \fI\fR elements. Possible values are \fIblock\fR, \&\fIparagraph\fR, \fIsentence\fR and \fIphrase\fR. Defaults to \fIsentence\fR. .IP srctmf 4 .IX Item "srctmf" Specifies the format of the translation memory file from which the TMX document or segment thereof have been generated. .IP adminlang 4 .IX Item "adminlang" Specifies the default language for the administrative and informative elements \fI\fR and \fI\fR. .IP srclang 4 .IX Item "srclang" Specifies the language of the source text. If a \fI\fR element does not have a srclang attribute specified, it uses the one defined in the \&\fI
\fR element. Defaults to \fI*all*\fR. .IP datatype 4 .IX Item "datatype" Specifies the type of data contained in the element. Depending on that type, you may apply different processes to the data. .Sp The recommended values for the datatype attribute are as follow (this list is not exhaustive): .RS 4 .IP unknown 4 .IX Item "unknown" undefined .IP alptext 4 .IX Item "alptext" WinJoust data .IP cdf 4 .IX Item "cdf" Channel Definition Format .IP cmx 4 .IX Item "cmx" Corel CMX Format .IP cpp 4 .IX Item "cpp" C and C++ style text .IP hptag 4 .IX Item "hptag" HP-Tag .IP html 4 .IX Item "html" HTML, DHTML, etc .IP interleaf 4 .IX Item "interleaf" Interleaf documents .IP ipf 4 .IX Item "ipf" IPF/BookMaster .IP java 4 .IX Item "java" Java, source and property files .IP javascript 4 .IX Item "javascript" JavaScript, ECMAScript scripts .IP lisp 4 .IX Item "lisp" Lisp .IP mif 4 .IX Item "mif" Framemaker MIF, MML, etc .IP opentag 4 .IX Item "opentag" OpenTag data .IP pascal 4 .IX Item "pascal" Pascal, Delphi style text .IP plaintext 4 .IX Item "plaintext" Plain text (default) .IP pm 4 .IX Item "pm" PageMaker .IP rtf 4 .IX Item "rtf" Rich Text Format .IP sgml 4 .IX Item "sgml" SGML .IP stf-f 4 .IX Item "stf-f" S\-Tagger for FrameMaker .IP stf-i 4 .IX Item "stf-i" S\-Tagger for Interleaf .IP transit 4 .IX Item "transit" Transit data .IP vbscript 4 .IX Item "vbscript" Visual Basic scripts .IP winres 4 .IX Item "winres" Windows resources from RC, DLL, EXE .IP xml 4 .IX Item "xml" XML .IP xptag 4 .IX Item "xptag" Quark XPressTag .RE .RS 4 .RE .IP srcencoding 4 .IX Item "srcencoding" All TMX documents are in Unicode. However, it is sometimes useful to know what code set was used to encode text that was converted to Unicode for purposes of interchange. This option specifies the original or preferred code set of the data of the element in case it is to be re-encoded in a non-Unicode code set. Defaults to none. .IP id 4 .IX Item "id" Specifies the identifier of the user who created the element. Defaults to none. .IP \-note 4 .IX Item "-note" A reference to a list of notes to be added in the header. .IP \-prop 4 .IX Item "-prop" A reference fo a hash of properties to be added in the header. Keys are used as the \f(CW\*(C`type\*(C'\fR attribute, value as the tag contents. .SS add_tu .IX Subsection "add_tu" .Vb 10 \& $tmx\->add_tu(srclang => LANG1, LANG1 => \*(Aqtext1\*(Aq, LANG2 => \*(Aqtext2\*(Aq); \& $tmx\->add_tu(srclang => LANG1, \& LANG1 => \*(Aqtext1\*(Aq, \& LANG2 => \*(Aqtext2\*(Aq, \& \-note => ["value1", ## notes \& "value2"], \& \-prop => { type1 => ["value1","value"], #multiple values \& _ => \*(Aqvalue2\*(Aq, # anonymound properties \& typen => ["valuen"],} \& ); .Ve .PP Adds a translation unit to the TMX file. Several optional labels can be specified: .IP id 4 .IX Item "id" Specifies an identifier for the \fI\fR element. Its value is not defined by the standard (it could be unique or not, numeric or alphanumeric, etc.). .IP srcencoding 4 .IX Item "srcencoding" Same meaning as told in \fBstart_tmx\fR method. .IP datatype 4 .IX Item "datatype" Same meaning as told in \fBstart_tmx\fR method. .IP segtype 4 .IX Item "segtype" Same meaning as told in \fBstart_tmx\fR method. .IP srclang 4 .IX Item "srclang" Same meaning as told in \fBstart_tmx\fR method. .SS end_tmx .IX Subsection "end_tmx" .Vb 1 \& $tmx\->end_tmx(); .Ve .PP Ends the TMX file, closing file handles if necessary. .SH "SEE ALSO" .IX Header "SEE ALSO" TMX Specification .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" Paulo Jorge Jesus Silva, .SH AUTHORS .IX Header "AUTHORS" .IP \(bu 4 Alberto Simões .IP \(bu 4 José João Almeida .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2010\-2017 by Projeto Natura . .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.