Skip to Main Content
Unix in a Nutshell, 4th Edition
book

Unix in a Nutshell, 4th Edition

by Arnold Robbins
October 2005
Intermediate to advanced content levelIntermediate to advanced
908 pages
46h 42m
English
O'Reilly Media, Inc.
Content preview from Unix in a Nutshell, 4th Edition

Name

xgettext

Synopsis

    xgettext [options] files
    xgettext -h

Solaris and GNU/Linux only. Extract messages (specially marked strings) from C and C++ source files. Place them in a “portable object” file (.po) for translation and compilation by msgfmt. By default, xgettext extracts strings only inside calls to the gettext (3C) and dgettext (3C) functions. Source files are named on the command line. A filename of - indicates the standard input. See also gettext and msgfmt.

GNU gettext extends the original Solaris gettext design and is able to extract strings from source files for a large number of languages. The URL for it is http://www.info-zip.org/.

Common Options

-a, --extract-all

Extract all strings, not just those in calls to gettext or dgettext. (GNU/Linux: applies to languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, Tcl, Perl, PHP, GCC-source, and Glade.)

-ctag, --add-comments[=tag]

Copy source file comments marked with tag into the .po file as #-delimited comments.

-ddomain, --default-domain=domain

Use domain .po as the output file instead of messages.po.

-h, --help

Print a help message on the standard output.

-j, --join-existing

Join (merge) extracted messages with those in the current .po file. Domain directives in the existing .po file are ignored.

-mprefix, --msgstrr-prefix=prefix

Fill in each msgstr with prefix. Intended for debugging. The GNU version allows prefix to be optional.

-Msuffix, --msgstr-suffix=suffix

Fill in each msgstr with suffix

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the Unix Operating System, 5th Edition

Learning the Unix Operating System, 5th Edition

John Strang, Grace Todino, Jerry Peek
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 0596100299Errata Page