XGETTEXT(1) GNU XGETTEXT(1)

xgettext - extract gettext strings from source

xgettext [OPTION] [INPUTFILE]...

Extract translatable strings from given input files.

Mandatory arguments to long options are mandatory for short options too. Similarly for optional arguments.

input files
get list of input files from FILE
add DIRECTORY to list for input files search

If input file is -, standard input is read.

use NAME.po for output (instead of messages.po)
write output to specified file
output files will be placed in directory DIR

If output file is -, output is written to standard output.

recognise the specified language (C, C++, ObjectiveC, PO, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Smalltalk, Java, JavaProperties, C#, awk, YCP, Tcl, Perl, PHP, GCC-source, NXStringTable, RST, Glade)
shorthand for --language=C++

By default the language is guessed depending on the input file name extension.

encoding of input files (except for Python, Tcl, Glade)

By default the input files are assumed to be in ASCII.

join messages with existing file
entries from FILE.po are not extracted
place comment block with TAG (or those preceding keyword lines) in output file

extract all strings (only languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, Tcl, Perl, PHP, GCC-source, Glade)
additional keyword to be looked for (without WORD means not to use default keywords)
(only languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, Tcl, Perl, PHP, GCC-source, Glade)
additional flag for strings inside the argument number ARG of keyword WORD
(only languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, YCP, Tcl, Perl, PHP, GCC-source)
understand ANSI C trigraphs for input (only languages C, C++, ObjectiveC)
recognize Qt format strings (only language C++)
recognize Boost format strings (only language C++)
more detailed formatstring recognition result

do not use C escapes in output (default)
use C escapes in output, no extended chars
write PO file even if empty
write the .po file using indented style
do not write '#: filename:line' lines
generate '#: filename:line' lines (default)
write out strict Uniforum conforming .po file
write out a Java .properties file
write out a NeXTstep/GNUstep .strings file
set output page width
do not break long message lines, longer than the output page width, into several lines
generate sorted output
sort output by file location
don't write header with `msgid ""' entry
set copyright holder in output
omit FSF copyright in output for foreign user
set report address for msgid bugs
use STRING or "" as prefix for msgstr entries
use STRING or "" as suffix for msgstr entries

display this help and exit
output version information and exit

Written by Ulrich Drepper.

Report bugs to <bug-gnu-gettext@gnu.org>.

Copyright © 1995-1998, 2000-2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

The full documentation for xgettext is maintained as a Texinfo manual. If the info and xgettext programs are properly installed at your site, the command

info xgettext

should give you access to the complete manual.

November 2006 GNU gettext-tools 0.16.1