Imported Upstream version 0.18.1.1
[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 --add-location
104 @opindex --add-location@r{, @code{msgconv} option}
105 Generate @samp{#: @var{filename}:@var{line}} lines (default).
106
107 @item --strict
108 @opindex --strict@r{, @code{msgconv} option}
109 Write out a strict Uniforum conforming PO file.  Note that this
110 Uniforum format should be avoided because it doesn't support the
111 GNU extensions.
112
113 @item -p
114 @itemx --properties-output
115 @opindex -p@r{, @code{msgconv} option}
116 @opindex --properties-output@r{, @code{msgconv} option}
117 Write out a Java ResourceBundle in Java @code{.properties} syntax.  Note
118 that this file format doesn't support plural forms and silently drops
119 obsolete messages.
120
121 @item --stringtable-output
122 @opindex --stringtable-output@r{, @code{msgconv} option}
123 Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax.
124 Note that this file format doesn't support plural forms.
125
126 @item -w @var{number}
127 @itemx --width=@var{number}
128 @opindex -w@r{, @code{msgconv} option}
129 @opindex --width@r{, @code{msgconv} option}
130 Set the output page width.  Long strings in the output files will be
131 split across multiple lines in order to ensure that each line's width
132 (= number of screen columns) is less or equal to the given @var{number}.
133
134 @item --no-wrap
135 @opindex --no-wrap@r{, @code{msgconv} option}
136 Do not break long message lines.  Message lines whose width exceeds the
137 output page width will not be split into several lines.  Only file reference
138 lines which are wider than the output page width will be split.
139
140 @item -s
141 @itemx --sort-output
142 @opindex -s@r{, @code{msgconv} option}
143 @opindex --sort-output@r{, @code{msgconv} option}
144 Generate sorted output.  Note that using this option makes it much harder
145 for the translator to understand each message's context.
146
147 @item -F
148 @itemx --sort-by-file
149 @opindex -F@r{, @code{msgconv} option}
150 @opindex --sort-by-file@r{, @code{msgconv} option}
151 Sort output by file location.
152
153 @end table
154
155 @subsection Informative output
156
157 @table @samp
158 @item -h
159 @itemx --help
160 @opindex -h@r{, @code{msgconv} option}
161 @opindex --help@r{, @code{msgconv} option}
162 Display this help and exit.
163
164 @item -V
165 @itemx --version
166 @opindex -V@r{, @code{msgconv} option}
167 @opindex --version@r{, @code{msgconv} option}
168 Output version information and exit.
169
170 @end table