1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302
|
@pindex msgfmt
@cindex @code{msgfmt} program, usage
@example
msgfmt [@var{option}] @var{filename}.po @dots{}
@end example
@cindex generate binary message catalog from PO file
The @code{msgfmt} programs generates a binary message catalog from a textual
translation description.
@subsection Input file location
@table @samp
@item @var{filename}.po @dots{}
@item -D @var{directory}
@itemx --directory=@var{directory}
@opindex -D@r{, @code{msgfmt} option}
@opindex --directory@r{, @code{msgfmt} option}
Add @var{directory} to the list of directories. Source files are
searched relative to this list of directories. The resulting @file{.po}
file will be written relative to the current directory, though.
@end table
If an input file is @samp{-}, standard input is read.
@subsection Operation mode
@table @samp
@item -j
@itemx --java
@opindex -j@r{, @code{msgfmt} option}
@opindex --java@r{, @code{msgfmt} option}
@cindex Java mode, and @code{msgfmt} program
Java mode: generate a Java @code{ResourceBundle} class.
@item --java2
@opindex --java2@r{, @code{msgfmt} option}
Like --java, and assume Java2 (JDK 1.2 or higher).
@item --csharp
@opindex --csharp@r{, @code{msgfmt} option}
@cindex C# mode, and @code{msgfmt} program
C# mode: generate a .NET .dll file containing a subclass of
@code{GettextResourceSet}.
@item --csharp-resources
@opindex --csharp-resources@r{, @code{msgfmt} option}
@cindex C# resources mode, and @code{msgfmt} program
C# resources mode: generate a .NET @file{.resources} file.
@item --tcl
@opindex --tcl@r{, @code{msgfmt} option}
@cindex Tcl mode, and @code{msgfmt} program
Tcl mode: generate a tcl/msgcat @file{.msg} file.
@item --qt
@opindex --qt@r{, @code{msgfmt} option}
@cindex Qt mode, and @code{msgfmt} program
Qt mode: generate a Qt @file{.qm} file.
@end table
@subsection Output file location
@table @samp
@item -o @var{file}
@itemx --output-file=@var{file}
@opindex -o@r{, @code{msgfmt} option}
@opindex --output-file@r{, @code{msgfmt} option}
Write output to specified file.
@item --strict
@opindex --strict@r{, @code{msgfmt} option}
Direct the program to work strictly following the Uniforum/Sun
implementation. Currently this only affects the naming of the output
file. If this option is not given the name of the output file is the
same as the domain name. If the strict Uniforum mode is enabled the
suffix @file{.mo} is added to the file name if it is not already
present.
We find this behaviour of Sun's implementation rather silly and so by
default this mode is @emph{not} selected.
@end table
If the output @var{file} is @samp{-}, output is written to standard output.
@subsection Output file location in Java mode
@table @samp
@item -r @var{resource}
@itemx --resource=@var{resource}
@opindex -r@r{, @code{msgfmt} option}
@opindex --resource@r{, @code{msgfmt} option}
Specify the resource name.
@item -l @var{locale}
@itemx --locale=@var{locale}
@opindex -l@r{, @code{msgfmt} option}
@opindex --locale@r{, @code{msgfmt} option}
Specify the locale name, either a language specification of the form @var{ll}
or a combined language and country specification of the form @var{ll_CC}.
@item -d @var{directory}
@opindex -d@r{, @code{msgfmt} option}
Specify the base directory of classes directory hierarchy.
@end table
The class name is determined by appending the locale name to the resource name,
separated with an underscore. The @samp{-d} option is mandatory. The class
is written under the specified directory.
@subsection Output file location in C# mode
@table @samp
@item -r @var{resource}
@itemx --resource=@var{resource}
@opindex -r@r{, @code{msgfmt} option}
@opindex --resource@r{, @code{msgfmt} option}
Specify the resource name.
@item -l @var{locale}
@itemx --locale=@var{locale}
@opindex -l@r{, @code{msgfmt} option}
@opindex --locale@r{, @code{msgfmt} option}
Specify the locale name, either a language specification of the form @var{ll}
or a combined language and country specification of the form @var{ll_CC}.
@item -d @var{directory}
@opindex -d@r{, @code{msgfmt} option}
Specify the base directory for locale dependent @file{.dll} files.
@end table
The @samp{-l} and @samp{-d} options are mandatory. The @file{.dll} file is
written in a subdirectory of the specified directory whose name depends on the
locale.
@subsection Output file location in Tcl mode
@table @samp
@item -l @var{locale}
@itemx --locale=@var{locale}
@opindex -l@r{, @code{msgfmt} option}
@opindex --locale@r{, @code{msgfmt} option}
Specify the locale name, either a language specification of the form @var{ll}
or a combined language and country specification of the form @var{ll_CC}.
@item -d @var{directory}
@opindex -d@r{, @code{msgfmt} option}
Specify the base directory of @file{.msg} message catalogs.
@end table
The @samp{-l} and @samp{-d} options are mandatory. The @file{.msg} file is
written in the specified directory.
@subsection Input file syntax
@table @samp
@item -P
@itemx --properties-input
@opindex -P@r{, @code{msgfmt} option}
@opindex --properties-input@r{, @code{msgfmt} option}
Assume the input files are Java ResourceBundles in Java @code{.properties}
syntax, not in PO file syntax.
@item --stringtable-input
@opindex --stringtable-input@r{, @code{msgfmt} option}
Assume the input files are NeXTstep/GNUstep localized resource files in
@code{.strings} syntax, not in PO file syntax.
@end table
@subsection Input file interpretation
@table @samp
@item -c
@itemx --check
@opindex -c@r{, @code{msgfmt} option}
@opindex --check@r{, @code{msgfmt} option}
Perform all the checks implied by @code{--check-format}, @code{--check-header},
@code{--check-domain}.
@item --check-format
@opindex --check-format@r{, @code{msgfmt} option}
@cindex check format strings
Check language dependent format strings.
If the string represents a format string used in a
@code{printf}-like function both strings should have the same number of
@samp{%} format specifiers, with matching types. If the flag
@code{c-format} or @code{possible-c-format} appears in the special
comment @key{#,} for this entry a check is performed. For example, the
check will diagnose using @samp{%.*s} against @samp{%s}, or @samp{%d}
against @samp{%s}, or @samp{%d} against @samp{%x}. It can even handle
positional parameters.
Normally the @code{xgettext} program automatically decides whether a
string is a format string or not. This algorithm is not perfect,
though. It might regard a string as a format string though it is not
used in a @code{printf}-like function and so @code{msgfmt} might report
errors where there are none.
To solve this problem the programmer can dictate the decision to the
@code{xgettext} program (@pxref{c-format}). The translator should not
consider removing the flag from the @key{#,} line. This "fix" would be
reversed again as soon as @code{msgmerge} is called the next time.
@item --check-header
@opindex --check-header@r{, @code{msgfmt} option}
Verify presence and contents of the header entry. @xref{Header Entry},
for a description of the various fields in the header entry.
@item --check-domain
@opindex --check-domain@r{, @code{msgfmt} option}
Check for conflicts between domain directives and the @code{--output-file}
option
@item -C
@itemx --check-compatibility
@opindex -C@r{, @code{msgfmt} option}
@opindex --check-compatibility@r{, @code{msgfmt} option}
@cindex compatibility with X/Open @code{msgfmt}
Check that GNU msgfmt behaves like X/Open msgfmt. This will give an error
when attempting to use the GNU extensions.
@item --check-accelerators[=@var{char}]
@opindex --check-accelerators@r{, @code{msgfmt} option}
@cindex keyboard accelerator checking
@cindex menu, keyboard accelerator support
@cindex mnemonics of menu entries
Check presence of keyboard accelerators for menu items. This is based on
the convention used in some GUIs that a keyboard accelerator in a menu
item string is designated by an immediately preceding @samp{&} character.
Sometimes a keyboard accelerator is also called "keyboard mnemonic".
This check verifies that if the untranslated string has exactly one
@samp{&} character, the translated string has exactly one @samp{&} as well.
If this option is given with a @var{char} argument, this @var{char} should
be a non-alphanumeric character and is used as keyboard accelerator mark
instead of @samp{&}.
@item -f
@itemx --use-fuzzy
@opindex -f@r{, @code{msgfmt} option}
@opindex --use-fuzzy@r{, @code{msgfmt} option}
@cindex force use of fuzzy entries
Use fuzzy entries in output. Note that using this option is usually wrong,
because fuzzy messages are exactly those which have not been validated by
a human translator.
@end table
@subsection Output details
@table @samp
@item -a @var{number}
@itemx --alignment=@var{number}
@opindex -a@r{, @code{msgfmt} option}
@opindex --alignment@r{, @code{msgfmt} option}
Align strings to @var{number} bytes (default: 1).
@c Currently the README mentions that this constant could be changed by
@c the installer by changing the value in config.h. Should this go away?
@item --no-hash
@opindex --no-hash@r{, @code{msgfmt} option}
Don't include a hash table in the binary file. Lookup will be more expensive
at run time (binary search instead of hash table lookup).
@end table
@subsection Informative output
@table @samp
@item -h
@itemx --help
@opindex -h@r{, @code{msgfmt} option}
@opindex --help@r{, @code{msgfmt} option}
Display this help and exit.
@item -V
@itemx --version
@opindex -V@r{, @code{msgfmt} option}
@opindex --version@r{, @code{msgfmt} option}
Output version information and exit.
@item --statistics
@opindex --statistics@r{, @code{msgfmt} option}
Print statistics about translations. When the option @code{--verbose} is used
in combination with @code{--statistics}, the input file name is printed in
front of the statistics line.
@item -v
@itemx --verbose
@opindex -v@r{, @code{msgfmt} option}
@opindex --verbose@r{, @code{msgfmt} option}
Increase verbosity level.
@end table
|