O'Reilly logo

Unix in a Nutshell, 4th Edition by Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required