Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / doc / msgconv.texi
1 @pindex msgconv
2 @cindex @code{msgconv} program, usage
3 @example
4 msgconv [@var{option}] [@var{inputfile}]
5 @end example
6
7 @cindex convert translations to a different encoding
8 The @code{msgconv} program converts a translation catalog to a different
9 character encoding.
10
11 @subsection Input file location
12
13 @table @samp
14 @item @var{inputfile}
15 Input PO file.
16
17 @item -D @var{directory}
18 @itemx --directory=@var{directory}
19 @opindex -D@r{, @code{msgconv} option}
20 @opindex --directory@r{, @code{msgconv} option}
21 Add @var{directory} to the list of directories.  Source files are
22 searched relative to this list of directories.  The resulting @file{.po}
23 file will be written relative to the current directory, though.
24
25 @end table
26
27 If no @var{inputfile} is given or if it is @samp{-}, standard input is read.
28
29 @subsection Output file location
30
31 @table @samp
32 @item -o @var{file}
33 @itemx --output-file=@var{file}
34 @opindex -o@r{, @code{msgconv} option}
35 @opindex --output-file@r{, @code{msgconv} option}
36 Write output to specified file.
37
38 @end table
39
40 The results are written to standard output if no output file is specified
41 or if it is @samp{-}.
42
43 @subsection Conversion target
44
45 @table @samp
46 @item -t
47 @itemx --to-code=@var{name}
48 @opindex -t@r{, @code{msgconv} option}
49 @opindex --to-code@r{, @code{msgconv} option}
50 Specify encoding for output.
51
52 @end table
53
54 The default encoding is the current locale's encoding.
55
56 @subsection Input file syntax
57
58 @table @samp
59 @item -P
60 @itemx --properties-input
61 @opindex -P@r{, @code{msgconv} option}
62 @opindex --properties-input@r{, @code{msgconv} option}
63 Assume the input file is a Java ResourceBundle in Java @code{.properties}
64 syntax, not in PO file syntax.
65
66 @item --stringtable-input
67 @opindex --stringtable-input@r{, @code{msgonv} option}
68 Assume the input file is a NeXTstep/GNUstep localized resource file in
69 @code{.strings} syntax, not in PO file syntax.
70
71 @end table
72
73 @subsection Output details
74
75 @c --no-escape and --escape omitted on purpose.  They are not useful.
76
77 @table @samp
78 @item --color
79 @itemx --color=@var{when}
80 @opindex --color@r{, @code{msgconv} option}
81 Specify whether or when to use colors and other text attributes.
82 See @ref{The --color option} for details.
83
84 @item --style=@var{style_file}
85 @opindex --style@r{, @code{msgconv} option}
86 Specify the CSS style rule file to use for @code{--color}.
87 See @ref{The --style option} for details.
88
89 @item --force-po
90 @opindex --force-po@r{, @code{msgconv} option}
91 Always write an output file even if it contains no message.
92
93 @item -i
94 @itemx --indent
95 @opindex -i@r{, @code{msgconv} option}
96 @opindex --indent@r{, @code{msgconv} option}
97 Write the .po file using indented style.
98
99 @item --no-location
100 @opindex --no-location@r{, @code{msgconv} option}
101 Do not write @samp{#: @var{filename}:@var{line}} lines.
102
103 @item -n
104 @itemx --add-location=@var{type}
105 @opindex --add-location@r{, @code{msgconv} option}
106 Generate @samp{#: @var{filename}:@var{line}} lines (default).
107
108 The optional @var{type} can be either @samp{full}, @samp{file}, or
109 @samp{never}.  If it is not given or @samp{full}, it generates the
110 lines with both file name and line number.  If it is @samp{file}, the
111 line number part is omitted.  If it is @samp{never}, it completely
112 suppresses the lines (same as @code{--no-location}).
113
114 @item --strict
115 @opindex --strict@r{, @code{msgconv} option}
116 Write out a strict Uniforum conforming PO file.  Note that this
117 Uniforum format should be avoided because it doesn't support the
118 GNU extensions.
119
120 @item -p
121 @itemx --properties-output
122 @opindex -p@r{, @code{msgconv} option}
123 @opindex --properties-output@r{, @code{msgconv} option}
124 Write out a Java ResourceBundle in Java @code{.properties} syntax.  Note
125 that this file format doesn't support plural forms and silently drops
126 obsolete messages.
127
128 @item --stringtable-output
129 @opindex --stringtable-output@r{, @code{msgconv} option}
130 Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax.
131 Note that this file format doesn't support plural forms.
132
133 @item -w @var{number}
134 @itemx --width=@var{number}
135 @opindex -w@r{, @code{msgconv} option}
136 @opindex --width@r{, @code{msgconv} option}
137 Set the output page width.  Long strings in the output files will be
138 split across multiple lines in order to ensure that each line's width
139 (= number of screen columns) is less or equal to the given @var{number}.
140
141 @item --no-wrap
142 @opindex --no-wrap@r{, @code{msgconv} option}
143 Do not break long message lines.  Message lines whose width exceeds the
144 output page width will not be split into several lines.  Only file reference
145 lines which are wider than the output page width will be split.
146
147 @item -s
148 @itemx --sort-output
149 @opindex -s@r{, @code{msgconv} option}
150 @opindex --sort-output@r{, @code{msgconv} option}
151 Generate sorted output.  Note that using this option makes it much harder
152 for the translator to understand each message's context.
153
154 @item -F
155 @itemx --sort-by-file
156 @opindex -F@r{, @code{msgconv} option}
157 @opindex --sort-by-file@r{, @code{msgconv} option}
158 Sort output by file location.
159
160 @end table
161
162 @subsection Informative output
163
164 @table @samp
165 @item -h
166 @itemx --help
167 @opindex -h@r{, @code{msgconv} option}
168 @opindex --help@r{, @code{msgconv} option}
169 Display this help and exit.
170
171 @item -V
172 @itemx --version
173 @opindex -V@r{, @code{msgconv} option}
174 @opindex --version@r{, @code{msgconv} option}
175 Output version information and exit.
176
177 @end table