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