]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/doc/xopo.rst
Merge ^/vendor/llvm-openmp/dist up to its last change, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / libxo / doc / xopo.rst
1
2 xopo
3 ====
4
5 The `xopo` utility filters ".pot" files generated by the
6 :manpage:`xgettext(1)` utility to remove formatting information
7 suitable for use with the "{G:}" modifier.  This means that when the
8 developer changes the formatting portion of the field definitions, or
9 the fields modifiers, the string passed to :manpage:`gettext(3)` is
10 unchanged, avoiding the expense of updating any existing translation
11 files (".po" files).
12
13 The syntax for the xopo command is one of two forms; it can be used as
14 a filter for processing a .po or .pot file, rewriting the "*msgid*"
15 strings with a simplified message string.  In this mode, the input is
16 either standard input or a file given by the "-f" option, and the
17 output is either standard output or a file given by the "-o" option.
18
19 In the second mode, a simple message given using the "-s" option on
20 the command, and the simplified version of that message is printed on
21 stdout:
22
23   =========== =================================
24    Option      Meaning
25   =========== =================================
26    -o <file>   Output file name
27    -f <file>   Use the given .po file as input
28    -s <text>   Simplify a format string
29   =========== =================================
30
31 ::
32
33     EXAMPLE:
34         % xopo -s "There are {:count/%u} {:event/%.6s} events\n"
35         There are {:count} {:event} events\n
36
37         % xgettext --default-domain=foo --no-wrap \
38             --add-comments --keyword=xo_emit --keyword=xo_emit_h \
39             --keyword=xo_emit_warn -C -E -n --foreign-user \
40             -o foo.pot.raw foo.c
41         % xopo -f foo.pot.raw -o foo.pot
42
43 Use of the `--no-wrap` option for `xgettext` is required to
44 ensure that incoming msgid strings are not wrapped across multiple
45 lines.