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

« back to all changes in this revision

Viewing changes to xml2po/xml2po.1

  • Committer: Bazaar Package Importer
  • Author(s): Fernanda Giroleti Weiden
  • Date: 2005-04-28 12:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20050428124514-ic11r31sn9pb0z3j
Tags: 0.1.3-3
pkg-config added to build-depends (Closes: #306107).

Show diffs side-by-side

added added

removed removed

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