.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "XML::TMX::Writer 3pm" .TH XML::TMX::Writer 3pm "2012-06-05" "perl v5.14.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 "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use XML::TMX::Writer; \& \& my $tmx = new XML::TMX::Writer(); \& \& $tmx\->start_tmx(id => \*(Aqpaulojjs\*(Aq); \& \& $tmx\->add_tu(SRCLANG => \*(Aqen\*(Aq, \*(Aqen\*(Aq => \*(Aqsome text\*(Aq, \*(Aqpt\*(Aq => \*(Aqalgum texto\*(Aq); \& $tmx\->add_tu(SRCLANG => \*(Aqen\*(Aq, \& \*(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 \s-1TMX\s0 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 \s-1TMX\s0 file. Several options are available: .IP "\-output" 4 .IX Item "-output" Output of the \s-1TMX\s0, if none is defined stdout is used by default. .IP "tool" 4 .IX Item "tool" Tool used to create the \s-1TMX\s0. Defaults to 'XML::TMX::Writer' .IP "toolversion" 4 .IX Item "toolversion" Some version identification of the tool used to create the \s-1TMX\s0. 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 \s-1TMX\s0 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 \s-1CMX\s0 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" \&\s-1HTML\s0, \s-1DHTML\s0, 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 \s-1MIF\s0, \s-1MML\s0, 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" \&\s-1SGML\s0 .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 \s-1RC\s0, \s-1DLL\s0, \s-1EXE\s0 .IP "xml" 4 .IX Item "xml" \&\s-1XML\s0 .IP "xptag" 4 .IX Item "xptag" Quark XPressTag .RE .RS 4 .RE .IP "srcencoding" 4 .IX Item "srcencoding" All \s-1TMX\s0 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 \s-1TMX\s0 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 \s-1TMX\s0 file, closing file handles if necessary. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1TMX\s0 Specification .SH "AUTHOR" .IX Header "AUTHOR" Paulo Jorge Jesus Silva, .PP Alberto Simo\*~es, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2003 by Projecto Natura .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.