gettext: msgexec Invocation

1 
1 9.10 Invoking the ‘msgexec’ Program
1 ===================================
1 
1      msgexec [OPTION] COMMAND [COMMAND-OPTION]
1 
1    The ‘msgexec’ program applies a command to all translations of a
1 translation catalog.  The COMMAND can be any program that reads a
1 translation from standard input.  It is invoked once for each
1 translation.  Its output becomes msgexec’s output.  ‘msgexec’’s return
1 code is the maximum return code across all invocations.
1 
1    A special builtin command called ‘0’ outputs the translation,
1 followed by a null byte.  The output of ‘msgexec 0’ is suitable as input
1 for ‘xargs -0’.
1 
1 ‘--newline’
1      Add newline at the end of each input line.
1 
1    During each COMMAND invocation, the environment variable
1 ‘MSGEXEC_MSGID’ is bound to the message’s msgid, and the environment
1 variable ‘MSGEXEC_LOCATION’ is bound to the location in the PO file of
1 the message.  If the message has a context, the environment variable
1 ‘MSGEXEC_MSGCTXT’ is bound to the message’s msgctxt, otherwise it is
1 unbound.  If the message has a plural form, environment variable
1 ‘MSGEXEC_MSGID_PLURAL’ is bound to the message’s msgid_plural and
1 ‘MSGEXEC_PLURAL_FORM’ is bound to the order number of the plural
1 actually processed (starting with 0), otherwise both are unbound.  If
1 the message has a previous msgid (added by ‘msgmerge’), environment
1 variable ‘MSGEXEC_PREV_MSGCTXT’ is bound to the message’s previous
1 msgctxt, ‘MSGEXEC_PREV_MSGID’ is bound to the previous msgid, and
1 ‘MSGEXEC_PREV_MSGID_PLURAL’ is bound to the previous msgid_plural.
1 
1    Note: It is your responsibility to ensure that the COMMAND can cope
1 with input encoded in the translation catalog’s encoding.  If the
1 COMMAND wants input in a particular encoding, you can in a first step
1 convert the translation catalog to that encoding using the ‘msgconv’
1 program, before invoking ‘msgexec’.  If the COMMAND wants input in the
1 locale’s encoding, but you want to avoid the locale’s encoding, then you
1 can first convert the translation catalog to UTF-8 using the ‘msgconv’
1 program and then make ‘msgexec’ work in an UTF-8 locale, by using the
1 ‘LC_ALL’ environment variable.
1 
1 9.10.1 Input file location
1 --------------------------
1 
1 ‘-i INPUTFILE’
1 ‘--input=INPUTFILE’
1      Input PO file.
1 
1 ‘-D DIRECTORY’
1 ‘--directory=DIRECTORY’
1      Add DIRECTORY to the list of directories.  Source files are
1      searched relative to this list of directories.  The resulting ‘.po’
1      file will be written relative to the current directory, though.
1 
1    If no INPUTFILE is given or if it is ‘-’, standard input is read.
1 
1 9.10.2 Input file syntax
1 ------------------------
1 
1 ‘-P’
1 ‘--properties-input’
1      Assume the input file is a Java ResourceBundle in Java
1      ‘.properties’ syntax, not in PO file syntax.
1 
1 ‘--stringtable-input’
1      Assume the input file is a NeXTstep/GNUstep localized resource file
1      in ‘.strings’ syntax, not in PO file syntax.
1 
1 9.10.3 Informative output
1 -------------------------
1 
1 ‘-h’
1 ‘--help’
1      Display this help and exit.
1 
1 ‘-V’
1 ‘--version’
1      Output version information and exit.
1