Home | History | Annotate | Line # | Download | only in doc
      1 @pindex msgexec
      2 @cindex @code{msgexec} program, usage
      3 @example
      4 msgexec [@var{option}] @var{command} [@var{command-option}]
      5 @end example
      6 
      7 @cindex apply command to all translations in a catalog
      8 The @code{msgexec} program applies a command to all translations of a
      9 translation catalog.
     10 The @var{command} can be any program that reads a translation from standard
     11 input.  It is invoked once for each translation.  Its output becomes
     12 msgexec's output.  @code{msgexec}'s return code is the maximum return code
     13 across all invocations.
     14 
     15 @cindex @code{xargs}, and output from @code{msgexec}
     16 A special builtin command called @samp{0} outputs the translation, followed
     17 by a null byte.  The output of @samp{msgexec 0} is suitable as input for
     18 @samp{xargs -0}.
     19 
     20 @vindex MSGEXEC_MSGCTXT@r{, environment variable}
     21 @vindex MSGEXEC_MSGID@r{, environment variable}
     22 @vindex MSGEXEC_LOCATION@r{, environment variable}
     23 During each @var{command} invocation, the environment variable
     24 @code{MSGEXEC_MSGID} is bound to the message's msgid, and the environment
     25 variable @code{MSGEXEC_LOCATION} is bound to the location in the PO file
     26 of the message.  If the message has a context, the environment variable
     27 @code{MSGEXEC_MSGCTXT} is bound to the message's msgctxt, otherwise it is
     28 unbound.
     29 
     30 @cindex catalog encoding and @code{msgexec} output
     31 Note: It is your responsibility to ensure that the @var{command} can cope
     32 with input encoded in the translation catalog's encoding.  If the
     33 @var{command} wants input in a particular encoding, you can in a first step
     34 convert the translation catalog to that encoding using the @samp{msgconv}
     35 program, before invoking @samp{msgexec}.  If the @var{command} wants input
     36 in the locale's encoding, but you want to avoid the locale's encoding, then
     37 you can first convert the translation catalog to UTF-8 using the
     38 @samp{msgconv} program and then make @samp{msgexec} work in an UTF-8
     39 locale, by using the @code{LC_ALL} environment variable.
     40 
     41 @subsection Input file location
     42 
     43 @table @samp
     44 @item -i @var{inputfile}
     45 @itemx --input=@var{inputfile}
     46 @opindex -i@r{, @code{msgexec} option}
     47 @opindex --input@r{, @code{msgexec} option}
     48 Input PO file.
     49 
     50 @item -D @var{directory}
     51 @itemx --directory=@var{directory}
     52 @opindex -D@r{, @code{msgexec} option}
     53 @opindex --directory@r{, @code{msgexec} option}
     54 Add @var{directory} to the list of directories.  Source files are
     55 searched relative to this list of directories.  The resulting @file{.po}
     56 file will be written relative to the current directory, though.
     57 
     58 @end table
     59 
     60 If no @var{inputfile} is given or if it is @samp{-}, standard input is read.
     61 
     62 @subsection Input file syntax
     63 
     64 @table @samp
     65 @item -P
     66 @itemx --properties-input
     67 @opindex -P@r{, @code{msgexec} option}
     68 @opindex --properties-input@r{, @code{msgexec} option}
     69 Assume the input file is a Java ResourceBundle in Java @code{.properties}
     70 syntax, not in PO file syntax.
     71 
     72 @item --stringtable-input
     73 @opindex --stringtable-input@r{, @code{msgexec} option}
     74 Assume the input file is a NeXTstep/GNUstep localized resource file in
     75 @code{.strings} syntax, not in PO file syntax.
     76 
     77 @end table
     78 
     79 @subsection Informative output
     80 
     81 @table @samp
     82 @item -h
     83 @itemx --help
     84 @opindex -h@r{, @code{msgexec} option}
     85 @opindex --help@r{, @code{msgexec} option}
     86 Display this help and exit.
     87 
     88 @item -V
     89 @itemx --version
     90 @opindex -V@r{, @code{msgexec} option}
     91 @opindex --version@r{, @code{msgexec} option}
     92 Output version information and exit.
     93 
     94 @end table
     95