doc: Add an example regarding xgettext.

Reported by Andrea G. Monaco <andrea.monaco@autistici.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2020-12/msg00036.html>.

* gettext-tools/doc/xgettext.texi: Add an example.
This commit is contained in:
Bruno Haible 2024-10-18 19:19:38 +02:00
parent c31a5e4e90
commit 8f089a25a4

View File

@ -706,3 +706,18 @@ Output version information and exit.
Increase verbosity level.
@end table
@subsection Example
A sample invocation of @code{xgettext}, in a project
that has a single source file @file{src/hello.c}
that uses @samp{_} as shorthand for the @code{gettext} function,
could be:
@example
xgettext -o hello.pot \
--add-comments=TRANSLATORS: \
--keyword=_ --flag=_:1:pass-c-format \
--directory=.. \
src/hello.c
@end example