~ubuntu-branches/ubuntu/lucid/gnome-doc-utils/lucid

« back to all changes in this revision

Viewing changes to xml2po/xml2po.1

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-19 08:34:21 UTC
  • mto: (2.1.1 etch) (1.1.18 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20051219083421-k72rkh3n6vox1c0t
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\"Generated by db2man.xsl. Don't modify this, modify the source.
 
2
.de Sh \" Subsection
 
3
.br
 
4
.if t .Sp
 
5
.ne 5
 
6
.PP
 
7
\fB\\$1\fR
 
8
.PP
 
9
..
 
10
.de Sp \" Vertical space (when we can't use .PP)
 
11
.if t .sp .5v
 
12
.if n .sp
 
13
..
 
14
.de Ip \" List item
 
15
.br
 
16
.ie \\n(.$>=3 .ne \\$3
 
17
.el .ne 3
 
18
.IP "\\$1" \\$2
 
19
..
 
20
.TH "XML2PO" 1 "2005/02/10" "" ""
 
21
.SH NAME
 
22
xml2po \- program to create a PO-template file from a DocBook XML file and merge it back into a (translated) XML file
 
23
.SH "SYNOPSIS"
 
24
.ad l
 
25
.hy 0
 
26
.HP 7
 
27
\fBxml2po\fR [\fBOPTIONS\fR] [\fIXMLFILE\fR]
 
28
.ad
 
29
.hy
 
30
 
 
31
.SH "DESCRIPTION"
 
32
 
 
33
.PP
 
34
This manual page documents briefly the \fBxml2po\fR command\&.
 
35
 
 
36
.PP
 
37
\fBxml2po\fR is a simple Python program which extracts translatable content from free\-form XML documents and outputs gettext compatible POT files\&. Translated PO files can be turned into XML output again\&.
 
38
 
 
39
.PP
 
40
It can work it's magic with most "simple" tags, and for complicated tags one has to provide a list of all tags which are "final" (that will be put into one "message" in PO file), "ignored" (skipped over) and "space preserving"\&.
 
41
 
 
42
.SH "OPTIONS"
 
43
 
 
44
.PP
 
45
The program follows the usual GNU command line syntax, with long options starting with two dashes (`\-')\&. A summary of options is included below\&.
 
46
 
 
47
.TP
 
48
\fB\-a\fR, \fB\-\-automatic\-tags\fR
 
49
Automatically decides if tags are to be considered "final" or not\&.
 
50
 
 
51
.TP
 
52
\fB\-k\fR, \fB\-\-keep\-entities\fR
 
53
Don't expand entities (default)\&. See also the \fB\-e\fR option\&.
 
54
 
 
55
.TP
 
56
\fB\-e\fR, \fB\-\-expand\-all\-entities\fR
 
57
Expand all entities (including SYSTEM ones)\&.
 
58
 
 
59
.TP
 
60
\fB\-m\fR, \fB\-\-mode=\fITYPE\fR\fR
 
61
Treat tags as type \fITYPE\fR (default: docbook)\&.
 
62
 
 
63
.TP
 
64
\fB\-o\fR, \fB\-\-output=\fIFILE\fR\fR
 
65
Print resulting text (XML while merging translations with "\-p" or "\-t" options, POT template file while extracting strings, and translated PO file with "\-r" option) to the given FILE\&.
 
66
 
 
67
.TP
 
68
\fB\-p\fR, \fB\-\-po\-file=\fIFILE\fR\fR
 
69
Specify a PO FILE containing translation and output XML document with translations merged in\&. Using this option will overwrite the temporary file \fI\&.xml2po\&.mo\fR\&.
 
70
 
 
71
.TP
 
72
\fB\-r\fR, \fB\-\-reuse=\fIFILE\fR\fR
 
73
Specify a translated XML document in FILE with the same structure to generate translated PO file for XML document given on command line\&.
 
74
 
 
75
.TP
 
76
\fB\-t\fR, \fB\-\-translation=\fIFILE\fR\fR
 
77
Specify a MO file containing translation and output XML document with translations merged in\&.
 
78
 
 
79
.TP
 
80
\fB\-u\fR, \fB\-\-update\-translation=\fILANG\&.po\fR\fR
 
81
Updates a PO file using \fBmsgmerge\fR\&.
 
82
 
 
83
.TP
 
84
\fB\-l\fR, \fB\-\-language=\fILANG\fR\fR
 
85
Explicitely set language of the translation\&.
 
86
 
 
87
.TP
 
88
\fB\-h\fR, \fB\-\-help\fR
 
89
Show summary of options\&.
 
90
 
 
91
.TP
 
92
\fB\-v\fR, \fB\-\-version\fR
 
93
Show version of program\&.
 
94
 
 
95
.SH "EXAMPLES"
 
96
 
 
97
.SS "Creating POT template files"
 
98
 
 
99
.PP
 
100
To create a POT template \fIbook\&.pot\fR from an input file \fIbook\&.xml\fR, which consists of \fIchapter1\&.xml\fR and \fIchapter2\&.xml\fR (external entities), run:
 
101
 
 
102
.nf
 
103
 
 
104
                                \fB/usr/bin/xml2po\fR \fB\-o\fR book\&.pot book\&.xml chapter1\&.xml chapter2\&.xml
 
105
                        
 
106
.fi
 
107
 
 
108
.PP
 
109
To expand entities use the \fB\-e\fR option:
 
110
 
 
111
.nf
 
112
 
 
113
                                \fB/usr/bin/xml2po\fR \fB\-e \-o\fR book\&.pot book\&.xml
 
114
                        
 
115
.fi
 
116
 
 
117
.SS "Creating translated XML files (merging back PO files)"
 
118
 
 
119
.PP
 
120
After translating \fIbook\&.pot\fR into \fILANG\&.po\fR, merge the translations back by using \fB\-p\fR option for each XML file:
 
121
 
 
122
.nf
 
123
 
 
124
                                \fB/usr/bin/xml2po\fR \fB\-p\fR LANG\&.po \fB\-o\fR book\&.LANG\&.xml book\&.xml
 
125
                                \fB/usr/bin/xml2po\fR \fB\-p\fR LANG\&.po \fB\-o\fR chapter1\&.LANG\&.xml chapter1\&.xml
 
126
                                \fB/usr/bin/xml2po\fR \fB\-p\fR LANG\&.po \fB\-o\fR chapter2\&.LANG\&.xml chapter2\&.xml
 
127
                        
 
128
.fi
 
129
 
 
130
.PP
 
131
If you used the \fB\-e\fR option to expand entities, you should use it again to merge back the translation into an XML file:
 
132
 
 
133
.nf
 
134
 
 
135
                                \fB/usr/bin/xml2po\fR \fB\-e \-p\fR LANG\&.po \fB\-o\fR book\&.LANG\&.xml book\&.xml
 
136
                        
 
137
.fi
 
138
 
 
139
.SS "Updating PO files"
 
140
 
 
141
.PP
 
142
When base XML file changes, the real advantages of PO files come to surface\&. There are 2 ways to merge the translation\&. The first is to produce a new POT template file (additionally use the \fB\-e\fR if you decided earlier to expand entities)\&. Afterwards run \fBmsgmerge\fR to merge the translation with the new POT file:
 
143
 
 
144
.nf
 
145
 
 
146
                                \fB/usr/bin/msgmerge\fR \fB\-o\fR tmp\&.po LANG\&.po book\&.pot
 
147
                        
 
148
.fi
 
149
 
 
150
.PP
 
151
Now rename \fItmp\&.po\fR to \fILANG\&.po\fR and update your translation\&. Alternatively, \fBxml2po\fR provides the \fB\-u\fR option, which does exactly these two steps for you\&. The advantage is, that it also runs \fBmsgfmt\fR to give you a statistical output of translation status (count of translated, untranslated and fuzzy messages)\&. Additionally use the \fB\-e\fR if you decided earlier to expand entities:
 
152
 
 
153
.nf
 
154
 
 
155
                                \fB/usr/bin/xml2po\fR \fB\-u\fR LANG\&.po book\&.xml
 
156
                        
 
157
.fi
 
158
 
 
159
.SH "SEE ALSO"
 
160
 
 
161
.PP
 
162
\fBmsgmerge\fR (1), \fBmsgfmt\fR (1)
 
163
 
 
164
.SH "AUTHOR"
 
165
 
 
166
.PP
 
167
This manual page was written by Daniel Leidert <daniel\&.leidert@wgdd\&.de> for the Debian system (but may be used by others)\&. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation\&.
 
168