{
    "content": [
        {
            "type": "text",
            "text": "# X (info)\n\n## Sections\n\n- **File: gettext.info,  Node: xgettext Invocation,  Up: Template** (1 subsections)\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "X",
        "section": "",
        "mode": "info",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "File: gettext.info,  Node: xgettext Invocation,  Up: Template",
                "lines": 1,
                "subsections": [
                    {
                        "name": "5.1 Invoking the 'xgettext' Program",
                        "lines": 485
                    }
                ]
            }
        ],
        "sections": {
            "File: gettext.info,  Node: xgettext Invocation,  Up: Template": {
                "content": "",
                "subsections": [
                    {
                        "name": "5.1 Invoking the 'xgettext' Program",
                        "content": "xgettext [OPTION] [INPUTFILE] ...\n\nThe 'xgettext' program extracts translatable strings from given input\nfiles.\n\n\n'INPUTFILE ...'\nInput files.\n\n'-f FILE'\n'--files-from=FILE'\nRead the names of the input files from FILE instead of getting them\nfrom the command line.\n\n'-D DIRECTORY'\n'--directory=DIRECTORY'\nAdd DIRECTORY to the list of directories.  Source files are\nsearched relative to this list of directories.  The resulting '.po'\nfile will be written relative to the current directory, though.\n\nIf INPUTFILE is '-', standard input is read.\n\n\n'-d NAME'\n'--default-domain=NAME'\nUse 'NAME.po' for output (instead of 'messages.po').\n\n'-o FILE'\n'--output=FILE'\nWrite output to specified file (instead of 'NAME.po' or\n'messages.po').\n\n'-p DIR'\n'--output-dir=DIR'\nOutput files will be placed in directory DIR.\n\nIf the output FILE is '-' or '/dev/stdout', the output is written to\nstandard output.\n\n\n'-L NAME'\n'--language=NAME'\nSpecifies the language of the input files.  The supported languages\nare 'C', 'C++', 'ObjectiveC', 'PO', 'Shell', 'Python', 'Lisp',\n'EmacsLisp', 'librep', 'Scheme', 'Smalltalk', 'Java',\n'JavaProperties', 'C#', 'awk', 'YCP', 'Tcl', 'Perl', 'PHP', 'Ruby',\n'GCC-source', 'NXStringTable', 'RST', 'RSJ', 'Glade', 'Lua',\n'JavaScript', 'Vala', 'GSettings', 'Desktop'.\n\n'-C'\n'--c++'\nThis is a shorthand for '--language=C++'.\n\nBy default the language is guessed depending on the input file name\nextension.\n\n\n'--from-code=NAME'\nSpecifies the encoding of the input files.  This option is needed\nonly if some untranslated message strings or their corresponding\ncomments contain non-ASCII characters.  Note that Tcl and Glade\ninput files are always assumed to be in UTF-8, regardless of this\noption.\n\nBy default the input files are assumed to be in ASCII.\n\n\n'-j'\n'--join-existing'\nJoin messages with existing file.\n\n'-x FILE'\n'--exclude-file=FILE'\nEntries from FILE are not extracted.  FILE should be a PO or POT\nfile.\n\n'-c[TAG]'\n'--add-comments[=TAG]'\nPlace comment blocks starting with TAG and preceding keyword lines\nin the output file.  Without a TAG, the option means to put all\ncomment blocks preceding keyword lines in the output file.\n\nNote that comment blocks supposed to be extracted must be adjacent\nto keyword lines.  For example, in the following C source code:\n\n/* This is the first comment.  */\ngettext (\"foo\");\n\n/* This is the second comment: not extracted  */\ngettext (\n\"bar\");\n\ngettext (\n/* This is the third comment.  */\n\"baz\");\n\nThe second comment line will not be extracted, because there is one\nblank line between the comment line and the keyword.\n\n'--check[=CHECK]'\nPerform a syntax check on msgid and msgidplural.  The supported\nchecks are:\n\n'ellipsis-unicode'\nPrefer Unicode ellipsis character over ASCII '...'\n\n'space-ellipsis'\nProhibit whitespace before an ellipsis character\n\n'quote-unicode'\nPrefer Unicode quotation marks over ASCII '\"'`'\n\n'bullet-unicode'\nPrefer Unicode bullet character over ASCII '*' or '-'\n\nThe option has an effect on all input files.  To enable or disable\nchecks for a certain string, you can mark it with an 'xgettext:'\nspecial comment in the source file.  For example, if you specify\nthe '--check=space-ellipsis' option, but want to suppress the check\non a particular string, add the following comment:\n\n/* xgettext: no-space-ellipsis-check */\ngettext (\"We really want a space before ellipsis here ...\");\n\nThe 'xgettext:' comment can be followed by flags separated with a\ncomma.  The possible flags are of the form '[no-]NAME-check', where\nNAME is the name of a valid syntax check.  If a flag is prefixed by\n'no-', the meaning is negated.\n\nSome tests apply the checks to each sentence within the msgid,\nrather than the whole string.  xgettext detects the end of sentence\nby performing a pattern match, which usually looks for a period\nfollowed by a certain number of spaces.  The number is specified\nwith the '--sentence-end' option.\n\n'--sentence-end[=TYPE]'\nThe supported values are:\n\n'single-space'\nExpect at least one whitespace after a period\n\n'double-space'\nExpect at least two whitespaces after a period\n\n\n'-a'\n'--extract-all'\nExtract all strings.\n\nThis option has an effect with most languages, namely C, C++,\nObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk,\nTcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala,\nGSettings.\n\n'-k[KEYWORDSPEC]'\n'--keyword[=KEYWORDSPEC]'\nSpecify KEYWORDSPEC as an additional keyword to be looked for.\nWithout a KEYWORDSPEC, the option means to not use default\nkeywords.\n\nIf KEYWORDSPEC is a C identifier ID, 'xgettext' looks for strings\nin the first argument of each call to the function or macro ID.  If\nKEYWORDSPEC is of the form 'ID:ARGNUM', 'xgettext' looks for\nstrings in the ARGNUMth argument of the call.  If KEYWORDSPEC is of\nthe form 'ID:ARGNUM1,ARGNUM2', 'xgettext' looks for strings in the\nARGNUM1st argument and in the ARGNUM2nd argument of the call, and\ntreats them as singular/plural variants for a message with plural\nhandling.  Also, if KEYWORDSPEC is of the form\n'ID:CONTEXTARGNUMc,ARGNUM' or 'ID:ARGNUM,CONTEXTARGNUMc',\n'xgettext' treats strings in the CONTEXTARGNUMth argument as a\ncontext specifier.  And, as a special-purpose support for GNOME, if\nKEYWORDSPEC is of the form 'ID:ARGNUMg', 'xgettext' recognizes the\nARGNUMth argument as a string with context, using the GNOME 'glib'\nsyntax '\"msgctxt|msgid\"'.\nFurthermore, if KEYWORDSPEC is of the form 'ID:...,TOTALNUMARGSt',\n'xgettext' recognizes this argument specification only if the\nnumber of actual arguments is equal to TOTALNUMARGS.  This is\nuseful for disambiguating overloaded function calls in C++.\nFinally, if KEYWORDSPEC is of the form 'ID:ARGNUM...,\"XCOMMENT\"',\n'xgettext', when extracting a message from the specified argument\nstrings, adds an extracted comment XCOMMENT to the message.  Note\nthat when used through a normal shell command line, the\ndouble-quotes around the XCOMMENT need to be escaped.\n\nThis option has an effect with most languages, namely C, C++,\nObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk,\nTcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala,\nGSettings, Desktop.\n\nThe default keyword specifications, which are always looked for if\nnot explicitly disabled, are language dependent.  They are:\n\n* For C, C++, and GCC-source: 'gettext', 'dgettext:2',\n'dcgettext:2', 'ngettext:1,2', 'dngettext:2,3',\n'dcngettext:2,3', 'gettextnoop', and 'pgettext:1c,2',\n'dpgettext:2c,3', 'dcpgettext:2c,3', 'npgettext:1c,2,3',\n'dnpgettext:2c,3,4', 'dcnpgettext:2c,3,4'.\n\n* For Objective C: Like for C, and also 'NSLocalizedString',\n'', 'NSLocalizedStaticString', ''.\n\n* For Shell scripts: 'gettext', 'ngettext:1,2', 'evalgettext',\n'evalngettext:1,2', 'evalpgettext:1c,2',\n'evalnpgettext:1c,2,3'.\n\n* For Python: 'gettext', 'ugettext', 'dgettext:2',\n'ngettext:1,2', 'ungettext:1,2', 'dngettext:2,3', ''.\n\n* For Lisp: 'gettext', 'ngettext:1,2', 'gettext-noop'.\n\n* For EmacsLisp: ''.\n\n* For librep: ''.\n\n* For Scheme: 'gettext', 'ngettext:1,2', 'gettext-noop'.\n\n* For Java: 'GettextResource.gettext:2',\n'GettextResource.ngettext:2,3',\n'GettextResource.pgettext:2c,3',\n'GettextResource.npgettext:2c,3,4', 'gettext', 'ngettext:1,2',\n'pgettext:1c,2', 'npgettext:1c,2,3', 'getString'.\n\n* For C#: 'GetString', 'GetPluralString:1,2',\n'GetParticularString:1c,2',\n'GetParticularPluralString:1c,2,3'.\n\n* For awk: 'dcgettext', 'dcngettext:1,2'.\n\n* For Tcl: '::msgcat::mc'.\n\n* For Perl: 'gettext', '%gettext', '$gettext', 'dgettext:2',\n'dcgettext:2', 'ngettext:1,2', 'dngettext:2,3',\n'dcngettext:2,3', 'gettextnoop'.\n\n* For PHP: '', 'gettext', 'dgettext:2', 'dcgettext:2',\n'ngettext:1,2', 'dngettext:2,3', 'dcngettext:2,3'.\n\n* For Glade 1: 'label', 'title', 'text', 'format', 'copyright',\n'comments', 'previewtext', 'tooltip'.\n\n* For Lua: '', 'gettext.gettext', 'gettext.dgettext:2',\n'gettext.dcgettext:2', 'gettext.ngettext:1,2',\n'gettext.dngettext:2,3', 'gettext.dcngettext:2,3'.\n\n* For JavaScript: '', 'gettext', 'dgettext:2', 'dcgettext:2',\n'ngettext:1,2', 'dngettext:2,3', 'pgettext:1c,2',\n'dpgettext:2c,3'.\n\n* For Vala: '', 'Q', 'N', 'NC', 'dgettext:2', 'dcgettext:2',\n'ngettext:1,2', 'dngettext:2,3', 'dpgettext:2c,3',\n'dpgettext2:2c,3'.\n\n* For Desktop: 'Name', 'GenericName', 'Comment', 'Keywords'.\n\nTo disable the default keyword specifications, the option '-k' or\n'--keyword' or '--keyword=', without a KEYWORDSPEC, can be used.\n\n'--flag=WORD:ARG:FLAG'\nSpecifies additional flags for strings occurring as part of the\nARGth argument of the function WORD.  The possible flags are the\npossible format string indicators, such as 'c-format', and their\nnegations, such as 'no-c-format', possibly prefixed with 'pass-'.\nThe meaning of '--flag=FUNCTION:ARG:LANG-format' is that in\nlanguage LANG, the specified FUNCTION expects as ARGth argument a\nformat string.  (For those of you familiar with GCC function\nattributes, '--flag=FUNCTION:ARG:c-format' is roughly equivalent to\nthe declaration 'attribute ((format (printf, ARG,\n...)))' attached to FUNCTION in a C source file.)  For example, if\nyou use the 'error' function from GNU libc, you can specify its\nbehaviour through '--flag=error:3:c-format'.  The effect of this\nspecification is that 'xgettext' will mark as format strings all\n'gettext' invocations that occur as ARGth argument of FUNCTION.\nThis is useful when such strings contain no format string\ndirectives: together with the checks done by 'msgfmt -c' it will\nensure that translators cannot accidentally use format string\ndirectives that would lead to a crash at runtime.\nThe meaning of '--flag=FUNCTION:ARG:pass-LANG-format' is that in\nlanguage LANG, if the FUNCTION call occurs in a position that must\nyield a format string, then its ARGth argument must yield a format\nstring of the same type as well.  (If you know GCC function\nattributes, the '--flag=FUNCTION:ARG:pass-c-format' option is\nroughly equivalent to the declaration 'attribute\n((formatarg (ARG)))' attached to FUNCTION in a C source file.)\nFor example, if you use the '' shortcut for the 'gettext'\nfunction, you should use '--flag=:1:pass-c-format'.  The effect of\nthis specification is that 'xgettext' will propagate a format\nstring requirement for a '(\"string\")' call to its first argument,\nthe literal '\"string\"', and thus mark it as a format string.  This\nis useful when such strings contain no format string directives:\ntogether with the checks done by 'msgfmt -c' it will ensure that\ntranslators cannot accidentally use format string directives that\nwould lead to a crash at runtime.\nThis option has an effect with most languages, namely C, C++,\nObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java,\nC#, awk, YCP, Tcl, Perl, PHP, GCC-source, Lua, JavaScript, Vala.\n\n'-T'\n'--trigraphs'\nUnderstand ANSI C trigraphs for input.\nThis option has an effect only with the languages C, C++,\nObjectiveC.\n\n'--qt'\nRecognize Qt format strings.\nThis option has an effect only with the language C++.\n\n'--kde'\nRecognize KDE 4 format strings.\nThis option has an effect only with the language C++.\n\n'--boost'\nRecognize Boost format strings.\nThis option has an effect only with the language C++.\n\n'--debug'\nUse the flags 'c-format' and 'possible-c-format' to show who was\nresponsible for marking a message as a format string.  The latter\nform is used if the 'xgettext' program decided, the former form is\nused if the programmer prescribed it.\n\nBy default only the 'c-format' form is used.  The translator should\nnot have to care about these details.\n\nThis implementation of 'xgettext' is able to process a few awkward\ncases, like strings in preprocessor macros, ANSI concatenation of\nadjacent strings, and escaped end of lines for continued strings.\n\n\n'--color'\n'--color=WHEN'\nSpecify whether or when to use colors and other text attributes.\nSee *note The --color option:: for details.\n\n'--style=STYLEFILE'\nSpecify the CSS style rule file to use for '--color'.  See *note\nThe --style option:: for details.\n\n'--force-po'\nAlways write an output file even if no message is defined.\n\n'-i'\n'--indent'\nWrite the .po file using indented style.\n\n'--no-location'\nDo not write '#: FILENAME:LINE' lines.  Note that using this option\nmakes it harder for technically skilled translators to understand\neach message's context.\n\n'-n'\n'--add-location=TYPE'\nGenerate '#: FILENAME:LINE' lines (default).\n\nThe optional TYPE can be either 'full', 'file', or 'never'.  If it\nis not given or 'full', it generates the lines with both file name\nand line number.  If it is 'file', the line number part is omitted.\nIf it is 'never', it completely suppresses the lines (same as\n'--no-location').\n\n'--strict'\nWrite out a strict Uniforum conforming PO file.  Note that this\nUniforum format should be avoided because it doesn't support the\nGNU extensions.\n\n'--properties-output'\nWrite out a Java ResourceBundle in Java '.properties' syntax.  Note\nthat this file format doesn't support plural forms and silently\ndrops obsolete messages.\n\n'--stringtable-output'\nWrite out a NeXTstep/GNUstep localized resource file in '.strings'\nsyntax.  Note that this file format doesn't support plural forms.\n\n'--its=FILE'\nUse ITS rules defined in FILE.  Note that this is only effective\nwith XML files.\n\n'--itstool'\nWrite out comments recognized by itstool (<http://itstool.org>).\nNote that this is only effective with XML files.\n\n'-w NUMBER'\n'--width=NUMBER'\nSet the output page width.  Long strings in the output files will\nbe split across multiple lines in order to ensure that each line's\nwidth (= number of screen columns) is less or equal to the given\nNUMBER.\n\n'--no-wrap'\nDo not break long message lines.  Message lines whose width exceeds\nthe output page width will not be split into several lines.  Only\nfile reference lines which are wider than the output page width\nwill be split.\n\n'-s'\n'--sort-output'\nGenerate sorted output.  Note that using this option makes it much\nharder for the translator to understand each message's context.\n\n'-F'\n'--sort-by-file'\nSort output by file location.\n\n'--omit-header'\nDon't write header with 'msgid \"\"' entry.\n\nThis is useful for testing purposes because it eliminates a source\nof variance for generated '.gmo' files.  With '--omit-header', two\ninvocations of 'xgettext' on the same files with the same options\nat different times are guaranteed to produce the same results.\n\nNote that using this option will lead to an error if the resulting\nfile would not entirely be in ASCII.\n\n'--copyright-holder=STRING'\nSet the copyright holder in the output.  STRING should be the\ncopyright holder of the surrounding package.  (Note that the msgstr\nstrings, extracted from the package's sources, belong to the\ncopyright holder of the package.)  Translators are expected to\ntransfer or disclaim the copyright for their translations, so that\npackage maintainers can distribute them without legal risk.  If\nSTRING is empty, the output files are marked as being in the public\ndomain; in this case, the translators are expected to disclaim\ntheir copyright, again so that package maintainers can distribute\nthem without legal risk.\n\nThe default value for STRING is the Free Software Foundation, Inc.,\nsimply because 'xgettext' was first used in the GNU project.\n\n'--foreign-user'\nOmit FSF copyright in output.  This option is equivalent to\n'--copyright-holder='''.  It can be useful for packages outside the\nGNU project that want their translations to be in the public\ndomain.\n\n'--package-name=PACKAGE'\nSet the package name in the header of the output.\n\n'--package-version=VERSION'\nSet the package version in the header of the output.  This option\nhas an effect only if the '--package-name' option is also used.\n\n'--msgid-bugs-address=EMAIL@ADDRESS'\nSet the reporting address for msgid bugs.  This is the email\naddress or URL to which the translators shall report bugs in the\nuntranslated strings:\n\n- Strings which are not entire sentences; see the maintainer\nguidelines in *note Preparing Strings::.\n- Strings which use unclear terms or require additional context\nto be understood.\n- Strings which make invalid assumptions about notation of date,\ntime or money.\n- Pluralisation problems.\n- Incorrect English spelling.\n- Incorrect formatting.\n\nIt can be your email address, or a mailing list address where\ntranslators can write to without being subscribed, or the URL of a\nweb page through which the translators can contact you.\n\nThe default value is empty, which means that translators will be\nclueless!  Don't forget to specify this option.\n\n'-m[STRING]'\n'--msgstr-prefix[=STRING]'\nUse STRING (or \"\" if not specified) as prefix for msgstr values.\n\n'-M[STRING]'\n'--msgstr-suffix[=STRING]'\nUse STRING (or \"\" if not specified) as suffix for msgstr values.\n\n\n'-h'\n'--help'\nDisplay this help and exit.\n\n'-V'\n'--version'\nOutput version information and exit.\n\n'-v'\n'--verbose'\nIncrease verbosity level.\n"
                    }
                ]
            }
        }
    }
}