Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 54d7669a625a08765b4887d3f02d717a > files > 57

gettext-0.11.5-2mdk.i586.rpm

<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52a
     from gettext.texi on 6 August 2002 -->

<TITLE>GNU gettext utilities - 7  Manipulating PO Files</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_6.html">previous</A>, <A HREF="gettext_8.html">next</A>, <A HREF="gettext_22.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC61" HREF="gettext_toc.html#TOC61">7  Manipulating PO Files</A></H1>
<P>
<A NAME="IDX422"></A>

</P>
<P>
Sometimes it is necessary to manipulate PO files in a way that is better
performed automatically than by hand.  GNU <CODE>gettext</CODE> includes a
complete set of tools for this purpose.

</P>
<P>
<A NAME="IDX423"></A>
When merging two packages into a single package, the resulting POT file
will be the concatenation of the two packages' POT files.  Thus the
maintainer must concatenate the two existing package translations into
a single translation catalog, for each language.  This is best performed
using <SAMP>`msgcat&acute;</SAMP>.  It is then the translators' duty to deal with any
possible conflicts that arose during the merge.

</P>
<P>
<A NAME="IDX424"></A>
When a translator takes over the translation job from another translator,
but she uses a different character encoding in her locale, she will
convert the catalog to her character encoding.  This is best done through
the <SAMP>`msgconv&acute;</SAMP> program.

</P>
<P>
When a maintainer takes a source file with tagged messages from another
package, he should also take the existing translations for this source
file (and not let the translators do the same job twice).  One way to do
this is through <SAMP>`msggrep&acute;</SAMP>, another is to create a POT file for
that source file and use <SAMP>`msgmerge&acute;</SAMP>.

</P>
<P>
<A NAME="IDX425"></A>
<A NAME="IDX426"></A>
When a translator wants to adjust some translation catalog for a special
dialect or orthography -- for example, German as written in Switzerland
versus German as written in Germany -- she needs to apply some text
processing to every message in the catalog.  The tool for doing this is
<SAMP>`msgfilter&acute;</SAMP>.

</P>
<P>
Another use of <CODE>msgfilter</CODE> is to produce approximately the POT file for
which a given PO file was made.  This can be done through a filter command
like <SAMP>`msgfilter sed -e d | sed -e '/^# /d'&acute;</SAMP>.  Note that the original
POT file may have had different comments and different plural message counts,
that's why it's better to use the original POT file if available.

</P>
<P>
<A NAME="IDX427"></A>
When a translator wants to check her translations, for example according
to orthography rules or using a non-interactive spell checker, she can do
so using the <SAMP>`msgexec&acute;</SAMP> program.

</P>
<P>
<A NAME="IDX428"></A>
When third party tools create PO or POT files, sometimes duplicates cannot
be avoided.  But the GNU <CODE>gettext</CODE> tools give an error when they
encounter duplicate msgids in the same file and in the same domain.
To merge duplicates, the <SAMP>`msguniq&acute;</SAMP> program can be used.

</P>
<P>
<SAMP>`msgcomm&acute;</SAMP> is a more general tool for keeping or throwing away
duplicates, occurring in different files.

</P>
<P>
<SAMP>`msgcmp&acute;</SAMP> can be used to check whether a translation catalog is
completely translated.

</P>
<P>
<A NAME="IDX429"></A>
<SAMP>`msgattrib&acute;</SAMP> can be used to select and extract only the fuzzy
or untranslated messages of a translation catalog.

</P>
<P>
<SAMP>`msgen&acute;</SAMP> is useful as a first step for preparing English translation
catalogs.  It copies each message's msgid to its msgstr.

</P>



<H2><A NAME="SEC62" HREF="gettext_toc.html#TOC62">7.1  Invoking the <CODE>msgcat</CODE> Program</A></H2>

<P>
<A NAME="IDX430"></A>
<A NAME="IDX431"></A>

<PRE>
msgcat [<VAR>option</VAR>] [<VAR>inputfile</VAR>]...
</PRE>

<P>
<A NAME="IDX432"></A>
<A NAME="IDX433"></A>
The <CODE>msgcat</CODE> program concatenates and merges the specified PO files.
It finds messages which are common to two or more of the specified PO files.
By using the <CODE>--more-than</CODE> option, greater commonality may be requested
before messages are printed.  Conversely, the <CODE>--less-than</CODE> option may be
used to specify less commonality before messages are printed (i.e.
<SAMP>`--less-than=2&acute;</SAMP> will only print the unique messages).  Translations,
comments and extract comments will be cumulated, except that if
<CODE>--use-first</CODE> is specified, they will be taken from the first PO file
to define them.  File positions from all PO files will be cumulated.

</P>


<H3><A NAME="SEC63" HREF="gettext_toc.html#TOC63">7.1.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR> ...&acute;</SAMP>
<DD>
Input files.

<DT><SAMP>`-f <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--files-from=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX434"></A>
<A NAME="IDX435"></A>
Read the names of the input files from <VAR>file</VAR> instead of getting
them from the command line.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX436"></A>
<A NAME="IDX437"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If <VAR>inputfile</VAR> is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC64" HREF="gettext_toc.html#TOC64">7.1.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX438"></A>
<A NAME="IDX439"></A>
Write output to specified file.

</DL>

<P>
<A NAME="IDX440"></A>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC65" HREF="gettext_toc.html#TOC65">7.1.3  Message selection</A></H3>

<DL COMPACT>

<DT><SAMP>`-&#60; <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--less-than=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX441"></A>
<A NAME="IDX442"></A>
Print messages with less than <VAR>number</VAR> definitions, defaults to infinite
if not set.

<DT><SAMP>`-&#62; <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--more-than=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX443"></A>
<A NAME="IDX444"></A>
Print messages with more than <VAR>number</VAR> definitions, defaults to 0 if not
set.

<DT><SAMP>`-u&acute;</SAMP>
<DD>
<DT><SAMP>`--unique&acute;</SAMP>
<DD>
<A NAME="IDX445"></A>
<A NAME="IDX446"></A>
Shorthand for <SAMP>`--less-than=2&acute;</SAMP>.  Requests that only unique messages be
printed.

</DL>



<H3><A NAME="SEC66" HREF="gettext_toc.html#TOC66">7.1.4  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`-t&acute;</SAMP>
<DD>
<DT><SAMP>`--to-code=<VAR>name</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX447"></A>
<A NAME="IDX448"></A>
Specify encoding for output.

<DT><SAMP>`--use-first&acute;</SAMP>
<DD>
<A NAME="IDX449"></A>
Use first available translation for each message.  Don't merge several
translations into one.

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX450"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX451"></A>
<A NAME="IDX452"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX453"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`-n&acute;</SAMP>
<DD>
<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX454"></A>
<A NAME="IDX455"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX456"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX457"></A>
<A NAME="IDX458"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX459"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX460"></A>
<A NAME="IDX461"></A>
<A NAME="IDX462"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX463"></A>
<A NAME="IDX464"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC67" HREF="gettext_toc.html#TOC67">7.1.5  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX465"></A>
<A NAME="IDX466"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX467"></A>
<A NAME="IDX468"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC68" HREF="gettext_toc.html#TOC68">7.2  Invoking the <CODE>msgconv</CODE> Program</A></H2>

<P>
<A NAME="IDX469"></A>
<A NAME="IDX470"></A>

<PRE>
msgconv [<VAR>option</VAR>] [<VAR>inputfile</VAR>]
</PRE>

<P>
<A NAME="IDX471"></A>
The <CODE>msgconv</CODE> program converts a translation catalog to a different
character encoding.

</P>


<H3><A NAME="SEC69" HREF="gettext_toc.html#TOC69">7.2.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
Input PO file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX472"></A>
<A NAME="IDX473"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If no <VAR>inputfile</VAR> is given or if it is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC70" HREF="gettext_toc.html#TOC70">7.2.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX474"></A>
<A NAME="IDX475"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC71" HREF="gettext_toc.html#TOC71">7.2.3  Conversion target</A></H3>

<DL COMPACT>

<DT><SAMP>`-t&acute;</SAMP>
<DD>
<DT><SAMP>`--to-code=<VAR>name</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX476"></A>
<A NAME="IDX477"></A>
Specify encoding for output.

</DL>

<P>
The default encoding is the current locale's encoding.

</P>


<H3><A NAME="SEC72" HREF="gettext_toc.html#TOC72">7.2.4  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX478"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX479"></A>
<A NAME="IDX480"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX481"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX482"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX483"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX484"></A>
<A NAME="IDX485"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX486"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX487"></A>
<A NAME="IDX488"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX489"></A>
<A NAME="IDX490"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC73" HREF="gettext_toc.html#TOC73">7.2.5  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX491"></A>
<A NAME="IDX492"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX493"></A>
<A NAME="IDX494"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC74" HREF="gettext_toc.html#TOC74">7.3  Invoking the <CODE>msggrep</CODE> Program</A></H2>

<P>
<A NAME="IDX495"></A>
<A NAME="IDX496"></A>

<PRE>
msggrep [<VAR>option</VAR>] [<VAR>inputfile</VAR>]
</PRE>

<P>
<A NAME="IDX497"></A>
The <CODE>msggrep</CODE> program extracts all messages of a translation catalog
that match a given pattern or belong to some given source files.

</P>


<H3><A NAME="SEC75" HREF="gettext_toc.html#TOC75">7.3.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
Input PO file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX498"></A>
<A NAME="IDX499"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If no <VAR>inputfile</VAR> is given or if it is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC76" HREF="gettext_toc.html#TOC76">7.3.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX500"></A>
<A NAME="IDX501"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC77" HREF="gettext_toc.html#TOC77">7.3.3  Message selection</A></H3>


<PRE>
  [-N <VAR>sourcefile</VAR>]... [-M <VAR>domainname</VAR>]...
  [-K <VAR>msgid-pattern</VAR>] [-T <VAR>msgstr-pattern</VAR>] [-C <VAR>comment-pattern</VAR>]
</PRE>

<P>
A message is selected if

<UL>
<LI>it comes from one of the specified source files,

<LI>or if it comes from one of the specified domains,

<LI>or if <SAMP>`-K&acute;</SAMP> is given and its key (msgid or msgid_plural) matches

      <VAR>msgid-pattern</VAR>,
<LI>or if <SAMP>`-T&acute;</SAMP> is given and its translation (msgstr) matches

      <VAR>msgstr-pattern</VAR>,
<LI>or if <SAMP>`-C&acute;</SAMP> is given and the translator's comment matches

      <VAR>comment-pattern</VAR>.
</UL>

<P>
When more than one selection criterion is specified, the set of selected
messages is the union of the selected messages of each criterion.

</P>
<P>
<VAR>msgid-pattern</VAR> or <VAR>msgstr-pattern</VAR> syntax:

<PRE>
  [-E | -F] [-e <VAR>pattern</VAR> | -f <VAR>file</VAR>]...
</PRE>

<P>
<VAR>pattern</VAR>s are basic regular expressions by default, or extended regular
expressions if -E is given, or fixed strings if -F is given.

</P>
<DL COMPACT>

<DT><SAMP>`-N <VAR>sourcefile</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--location=<VAR>sourcefile</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX502"></A>
<A NAME="IDX503"></A>
Select messages extracted from <VAR>sourcefile</VAR>.  <VAR>sourcefile</VAR> can be
either a literal file name or a wildcard pattern.

<DT><SAMP>`-M <VAR>domainname</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--domain=<VAR>domainname</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX504"></A>
<A NAME="IDX505"></A>
Select messages belonging to domain <VAR>domainname</VAR>.

<DT><SAMP>`-K&acute;</SAMP>
<DD>
<DT><SAMP>`--msgid&acute;</SAMP>
<DD>
<A NAME="IDX506"></A>
<A NAME="IDX507"></A>
Start of patterns for the msgid.

<DT><SAMP>`-T&acute;</SAMP>
<DD>
<DT><SAMP>`--msgstr&acute;</SAMP>
<DD>
<A NAME="IDX508"></A>
<A NAME="IDX509"></A>
Start of patterns for the msgstr.

<DT><SAMP>`-E&acute;</SAMP>
<DD>
<DT><SAMP>`--extended-regexp&acute;</SAMP>
<DD>
<A NAME="IDX510"></A>
<A NAME="IDX511"></A>
Specify that <VAR>pattern</VAR> is an extended regular expression.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--fixed-strings&acute;</SAMP>
<DD>
<A NAME="IDX512"></A>
<A NAME="IDX513"></A>
Specify that <VAR>pattern</VAR> is a set of newline-separated strings.

<DT><SAMP>`-e <VAR>pattern</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--regexp=<VAR>pattern</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX514"></A>
<A NAME="IDX515"></A>
Use <VAR>pattern</VAR> as a regular expression.

<DT><SAMP>`-f <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX516"></A>
<A NAME="IDX517"></A>
Obtain <VAR>pattern</VAR> from <VAR>file</VAR>.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--ignore-case&acute;</SAMP>
<DD>
<A NAME="IDX518"></A>
<A NAME="IDX519"></A>
Ignore case distinctions.

</DL>



<H3><A NAME="SEC78" HREF="gettext_toc.html#TOC78">7.3.4  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX520"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX521"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX522"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX523"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX524"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX525"></A>
<A NAME="IDX526"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX527"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX528"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX529"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC79" HREF="gettext_toc.html#TOC79">7.3.5  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX530"></A>
<A NAME="IDX531"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX532"></A>
<A NAME="IDX533"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC80" HREF="gettext_toc.html#TOC80">7.4  Invoking the <CODE>msgfilter</CODE> Program</A></H2>

<P>
<A NAME="IDX534"></A>
<A NAME="IDX535"></A>

<PRE>
msgfilter [<VAR>option</VAR>] <VAR>filter</VAR> [<VAR>filter-option</VAR>]
</PRE>

<P>
<A NAME="IDX536"></A>
The <CODE>msgfilter</CODE> program applies a filter to all translations of a
translation catalog.

</P>


<H3><A NAME="SEC81" HREF="gettext_toc.html#TOC81">7.4.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-i <VAR>inputfile</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--input=<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX537"></A>
<A NAME="IDX538"></A>
Input PO file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX539"></A>
<A NAME="IDX540"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If no <VAR>inputfile</VAR> is given or if it is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC82" HREF="gettext_toc.html#TOC82">7.4.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX541"></A>
<A NAME="IDX542"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC83" HREF="gettext_toc.html#TOC83">7.4.3  The filter</A></H3>

<P>
The <VAR>filter</VAR> can be any program that reads a translation from standard
input and writes a modified translation to standard output.  A frequently
used filter is <SAMP>`sed&acute;</SAMP>.

</P>
<P>
<A NAME="IDX543"></A>
Note: It is your responsibility to ensure that the <VAR>filter</VAR> can cope
with input encoded in the translation catalog's encoding.  If the
<VAR>filter</VAR> wants input in a particular encoding, you can in a first step
convert the translation catalog to that encoding using the <SAMP>`msgconv&acute;</SAMP>
program, before invoking <SAMP>`msgfilter&acute;</SAMP>.  If the <VAR>filter</VAR> wants input
in the locale's encoding, but you want to avoid the locale's encoding, then
you can first convert the translation catalog to UTF-8 using the
<SAMP>`msgconv&acute;</SAMP> program and then make <SAMP>`msgfilter&acute;</SAMP> work in an UTF-8
locale, by using the <CODE>LC_ALL</CODE> environment variable.

</P>
<P>
<A NAME="IDX544"></A>
Note: Most translations in a translation catalog don't end with a newline
character. For this reason, it is important that the <VAR>filter</VAR>
recognizes its last input line even if it ends without a newline, and that
it doesn't add an undesired trailing newline at the end. The <SAMP>`sed&acute;</SAMP>
program on some platforms is known to ignore the last line of input if it
is not terminated with a newline. You can use GNU <CODE>sed</CODE> instead; it
does not have this limitation.

</P>


<H3><A NAME="SEC84" HREF="gettext_toc.html#TOC84">7.4.4  Useful <VAR>filter-option</VAR>s when the <VAR>filter</VAR> is <SAMP>`sed&acute;</SAMP></A></H3>

<DL COMPACT>

<DT><SAMP>`-e <VAR>script</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--expression=<VAR>script</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX545"></A>
<A NAME="IDX546"></A>
Add <VAR>script</VAR> to the commands to be executed.

<DT><SAMP>`-f <VAR>scriptfile</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--file=<VAR>scriptfile</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX547"></A>
<A NAME="IDX548"></A>
Add the contents of <VAR>scriptfile</VAR> to the commands to be executed.

<DT><SAMP>`-n&acute;</SAMP>
<DD>
<DT><SAMP>`--quiet&acute;</SAMP>
<DD>
<DT><SAMP>`--silent&acute;</SAMP>
<DD>
<A NAME="IDX549"></A>
<A NAME="IDX550"></A>
<A NAME="IDX551"></A>
Suppress automatic printing of pattern space.

</DL>



<H3><A NAME="SEC85" HREF="gettext_toc.html#TOC85">7.4.5  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX552"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX553"></A>
Write the .po file using indented style.

<DT><SAMP>`--keep-header&acute;</SAMP>
<DD>
<A NAME="IDX554"></A>
Keep the header entry, i.e. the message with <SAMP>`msgid ""&acute;</SAMP>, unmodified,
instead of filtering it.  By default, the header entry is subject to
filtering like any other message.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX555"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX556"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX557"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX558"></A>
<A NAME="IDX559"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX560"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX561"></A>
<A NAME="IDX562"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX563"></A>
<A NAME="IDX564"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC86" HREF="gettext_toc.html#TOC86">7.4.6  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX565"></A>
<A NAME="IDX566"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX567"></A>
<A NAME="IDX568"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC87" HREF="gettext_toc.html#TOC87">7.5  Invoking the <CODE>msguniq</CODE> Program</A></H2>

<P>
<A NAME="IDX569"></A>
<A NAME="IDX570"></A>

<PRE>
msguniq [<VAR>option</VAR>] [<VAR>inputfile</VAR>]
</PRE>

<P>
<A NAME="IDX571"></A>
<A NAME="IDX572"></A>
The <CODE>msguniq</CODE> program unifies duplicate translations in a translation
catalog.  It finds duplicate translations of the same message ID.  Such
duplicates are invalid input for other programs like <CODE>msgfmt</CODE>,
<CODE>msgmerge</CODE> or <CODE>msgcat</CODE>.  By default, duplicates are merged
together.  When using the <SAMP>`--repeated&acute;</SAMP> option, only duplicates are
output, and all other messages are discarded.  Comments and extracted
comments will be cumulated, except that if <SAMP>`--use-first&acute;</SAMP> is
specified, they will be taken from the first translation.  File positions
will be cumulated.  When using the <SAMP>`--unique&acute;</SAMP> option, duplicates are
discarded.

</P>


<H3><A NAME="SEC88" HREF="gettext_toc.html#TOC88">7.5.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
Input PO file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX573"></A>
<A NAME="IDX574"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If no <VAR>inputfile</VAR> is given or if it is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC89" HREF="gettext_toc.html#TOC89">7.5.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX575"></A>
<A NAME="IDX576"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC90" HREF="gettext_toc.html#TOC90">7.5.3  Message selection</A></H3>

<DL COMPACT>

<DT><SAMP>`-d&acute;</SAMP>
<DD>
<DT><SAMP>`--repeated&acute;</SAMP>
<DD>
<A NAME="IDX577"></A>
<A NAME="IDX578"></A>
Print only duplicates.

<DT><SAMP>`-u&acute;</SAMP>
<DD>
<DT><SAMP>`--unique&acute;</SAMP>
<DD>
<A NAME="IDX579"></A>
<A NAME="IDX580"></A>
Print only unique messages, discard duplicates.

</DL>



<H3><A NAME="SEC91" HREF="gettext_toc.html#TOC91">7.5.4  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`-t&acute;</SAMP>
<DD>
<DT><SAMP>`--to-code=<VAR>name</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX581"></A>
<A NAME="IDX582"></A>
Specify encoding for output.

<DT><SAMP>`--use-first&acute;</SAMP>
<DD>
<A NAME="IDX583"></A>
Use first available translation for each message.  Don't merge several
translations into one.

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX584"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX585"></A>
<A NAME="IDX586"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX587"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`-n&acute;</SAMP>
<DD>
<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX588"></A>
<A NAME="IDX589"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX590"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX591"></A>
<A NAME="IDX592"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX593"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX594"></A>
<A NAME="IDX595"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX596"></A>
<A NAME="IDX597"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC92" HREF="gettext_toc.html#TOC92">7.5.5  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX598"></A>
<A NAME="IDX599"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX600"></A>
<A NAME="IDX601"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC93" HREF="gettext_toc.html#TOC93">7.6  Invoking the <CODE>msgcomm</CODE> Program</A></H2>

<P>
<A NAME="IDX602"></A>
<A NAME="IDX603"></A>

<PRE>
msgcomm [<VAR>option</VAR>] [<VAR>inputfile</VAR>]...
</PRE>

<P>
<A NAME="IDX604"></A>
The <CODE>msgcomm</CODE> program finds messages which are common to two or more
of the specified PO files.
By using the <CODE>--more-than</CODE> option, greater commonality may be requested
before messages are printed.  Conversely, the <CODE>--less-than</CODE> option may be
used to specify less commonality before messages are printed (i.e.
<SAMP>`--less-than=2&acute;</SAMP> will only print the unique messages).  Translations,
comments and extract comments will be preserved, but only from the first
PO file to define them.  File positions from all PO files will be
cumulated.

</P>


<H3><A NAME="SEC94" HREF="gettext_toc.html#TOC94">7.6.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR> ...&acute;</SAMP>
<DD>
Input files.

<DT><SAMP>`-f <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--files-from=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX605"></A>
<A NAME="IDX606"></A>
Read the names of the input files from <VAR>file</VAR> instead of getting
them from the command line.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX607"></A>
<A NAME="IDX608"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If <VAR>inputfile</VAR> is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC95" HREF="gettext_toc.html#TOC95">7.6.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX609"></A>
<A NAME="IDX610"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC96" HREF="gettext_toc.html#TOC96">7.6.3  Message selection</A></H3>

<DL COMPACT>

<DT><SAMP>`-&#60; <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--less-than=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX611"></A>
<A NAME="IDX612"></A>
Print messages with less than <VAR>number</VAR> definitions, defaults to infinite
if not set.

<DT><SAMP>`-&#62; <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--more-than=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX613"></A>
<A NAME="IDX614"></A>
Print messages with more than <VAR>number</VAR> definitions, defaults to 1 if not
set.

<DT><SAMP>`-u&acute;</SAMP>
<DD>
<DT><SAMP>`--unique&acute;</SAMP>
<DD>
<A NAME="IDX615"></A>
<A NAME="IDX616"></A>
Shorthand for <SAMP>`--less-than=2&acute;</SAMP>.  Requests that only unique messages be
printed.

</DL>



<H3><A NAME="SEC97" HREF="gettext_toc.html#TOC97">7.6.4  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX617"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX618"></A>
<A NAME="IDX619"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX620"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`-n&acute;</SAMP>
<DD>
<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX621"></A>
<A NAME="IDX622"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX623"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX624"></A>
<A NAME="IDX625"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX626"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX627"></A>
<A NAME="IDX628"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX629"></A>
<A NAME="IDX630"></A>
Sort output by file location.

<DT><SAMP>`--omit-header&acute;</SAMP>
<DD>
<A NAME="IDX631"></A>
Don't write header with <SAMP>`msgid ""&acute;</SAMP> entry.

</DL>



<H3><A NAME="SEC98" HREF="gettext_toc.html#TOC98">7.6.5  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX632"></A>
<A NAME="IDX633"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX634"></A>
<A NAME="IDX635"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC99" HREF="gettext_toc.html#TOC99">7.7  Invoking the <CODE>msgcmp</CODE> Program</A></H2>

<P>
<A NAME="IDX636"></A>
<A NAME="IDX637"></A>

<PRE>
msgcmp [<VAR>option</VAR>] <VAR>def</VAR>.po <VAR>ref</VAR>.pot
</PRE>

<P>
<A NAME="IDX638"></A>
The <CODE>msgcmp</CODE> program compares two Uniforum style .po files to check that
both contain the same set of msgid strings.  The <VAR>def</VAR>.po file is an
existing PO file with the translations.  The <VAR>ref</VAR>.pot file is the last
created PO file, or a PO Template file (generally created by <CODE>xgettext</CODE>).
This is useful for checking that you have translated each and every message
in your program.  Where an exact match cannot be found, fuzzy matching is
used to produce better diagnostics.

</P>


<H3><A NAME="SEC100" HREF="gettext_toc.html#TOC100">7.7.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>def</VAR>.po&acute;</SAMP>
<DD>
Translations.

<DT><SAMP>`<VAR>ref</VAR>.pot&acute;</SAMP>
<DD>
References to the sources.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX639"></A>
<A NAME="IDX640"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.

</DL>



<H3><A NAME="SEC101" HREF="gettext_toc.html#TOC101">7.7.2  Operation modifiers</A></H3>

<DL COMPACT>

<DT><SAMP>`-m&acute;</SAMP>
<DD>
<DT><SAMP>`--multi-domain&acute;</SAMP>
<DD>
<A NAME="IDX641"></A>
<A NAME="IDX642"></A>
Apply <VAR>ref</VAR>.pot to each of the domains in <VAR>def</VAR>.po.

</DL>



<H3><A NAME="SEC102" HREF="gettext_toc.html#TOC102">7.7.3  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX643"></A>
<A NAME="IDX644"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX645"></A>
<A NAME="IDX646"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC103" HREF="gettext_toc.html#TOC103">7.8  Invoking the <CODE>msgattrib</CODE> Program</A></H2>

<P>
<A NAME="IDX647"></A>
<A NAME="IDX648"></A>

<PRE>
msgattrib [<VAR>option</VAR>] [<VAR>inputfile</VAR>]
</PRE>

<P>
<A NAME="IDX649"></A>
<A NAME="IDX650"></A>
The <CODE>msgattrib</CODE> program filters the messages of a translation catalog
according to their attributes, and manipulates the attributes.

</P>


<H3><A NAME="SEC104" HREF="gettext_toc.html#TOC104">7.8.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
Input PO file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX651"></A>
<A NAME="IDX652"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If no <VAR>inputfile</VAR> is given or if it is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC105" HREF="gettext_toc.html#TOC105">7.8.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX653"></A>
<A NAME="IDX654"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC106" HREF="gettext_toc.html#TOC106">7.8.3  Message selection</A></H3>

<DL COMPACT>

<DT><SAMP>`--translated&acute;</SAMP>
<DD>
<A NAME="IDX655"></A>
Keep translated messages, remove untranslated messages.

<DT><SAMP>`--untranslated&acute;</SAMP>
<DD>
<A NAME="IDX656"></A>
Keep untranslated messages, remove translated messages.

<DT><SAMP>`--no-fuzzy&acute;</SAMP>
<DD>
<A NAME="IDX657"></A>
Remove `fuzzy' marked messages.

<DT><SAMP>`--only-fuzzy&acute;</SAMP>
<DD>
<A NAME="IDX658"></A>
Keep `fuzzy' marked messages, remove all other messsages.

<DT><SAMP>`--no-obsolete&acute;</SAMP>
<DD>
<A NAME="IDX659"></A>
Remove obsolete #~ messages.

<DT><SAMP>`--only-obsolete&acute;</SAMP>
<DD>
<A NAME="IDX660"></A>
Keep obsolete #~ messages, remove all other messages.

</DL>



<H3><A NAME="SEC107" HREF="gettext_toc.html#TOC107">7.8.4  Attribute manipulation</A></H3>

<P>
<A NAME="IDX661"></A>
Attributes are modified after the message selection/removal has been
performed.

</P>
<DL COMPACT>

<DT><SAMP>`--set-fuzzy&acute;</SAMP>
<DD>
<A NAME="IDX662"></A>
Set all messages `fuzzy'.

<DT><SAMP>`--clear-fuzzy&acute;</SAMP>
<DD>
<A NAME="IDX663"></A>
Set all messages non-`fuzzy'.

<DT><SAMP>`--set-obsolete&acute;</SAMP>
<DD>
<A NAME="IDX664"></A>
Set all messages obsolete.

<DT><SAMP>`--clear-obsolete&acute;</SAMP>
<DD>
<A NAME="IDX665"></A>
Set all messages non-obsolete.

<DT><SAMP>`--fuzzy&acute;</SAMP>
<DD>
<A NAME="IDX666"></A>
Synonym for <SAMP>`--only-fuzzy --clear-fuzzy&acute;</SAMP>: It keeps only the fuzzy
messages and removes their `fuzzy' mark.

<DT><SAMP>`--obsolete&acute;</SAMP>
<DD>
<A NAME="IDX667"></A>
Synonym for <SAMP>`--only-obsolete --clear-obsolete&acute;</SAMP>: It keeps only the
obsolete messages and makes them non-obsolete.

</DL>



<H3><A NAME="SEC108" HREF="gettext_toc.html#TOC108">7.8.5  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX668"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX669"></A>
<A NAME="IDX670"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX671"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`-n&acute;</SAMP>
<DD>
<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX672"></A>
<A NAME="IDX673"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX674"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX675"></A>
<A NAME="IDX676"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX677"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX678"></A>
<A NAME="IDX679"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX680"></A>
<A NAME="IDX681"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC109" HREF="gettext_toc.html#TOC109">7.8.6  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX682"></A>
<A NAME="IDX683"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX684"></A>
<A NAME="IDX685"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC110" HREF="gettext_toc.html#TOC110">7.9  Invoking the <CODE>msgen</CODE> Program</A></H2>

<P>
<A NAME="IDX686"></A>
<A NAME="IDX687"></A>

<PRE>
msgen [<VAR>option</VAR>] <VAR>inputfile</VAR>
</PRE>

<P>
<A NAME="IDX688"></A>
The <CODE>msgen</CODE> program creates an English translation catalog.  The
input file is the last created English PO file, or a PO Template file
(generally created by xgettext).  Untranslated entries are assigned a
translation that is identical to the msgid, and are marked fuzzy.

</P>
<P>
Note: <SAMP>`msginit --no-translator --locale=en&acute;</SAMP> performs a very similar
task. The main difference is that <CODE>msginit</CODE> cares specially about
the header entry, whereas <CODE>msgen</CODE> doesn't.

</P>


<H3><A NAME="SEC111" HREF="gettext_toc.html#TOC111">7.9.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
Input PO or POT file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX689"></A>
<A NAME="IDX690"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If <VAR>inputfile</VAR> is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC112" HREF="gettext_toc.html#TOC112">7.9.2  Output file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-o <VAR>file</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--output-file=<VAR>file</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX691"></A>
<A NAME="IDX692"></A>
Write output to specified file.

</DL>

<P>
The results are written to standard output if no output file is specified
or if it is <SAMP>`-&acute;</SAMP>.

</P>


<H3><A NAME="SEC113" HREF="gettext_toc.html#TOC113">7.9.3  Output details</A></H3>

<DL COMPACT>

<DT><SAMP>`--force-po&acute;</SAMP>
<DD>
<A NAME="IDX693"></A>
Always write an output file even if it contains no message.

<DT><SAMP>`-i&acute;</SAMP>
<DD>
<DT><SAMP>`--indent&acute;</SAMP>
<DD>
<A NAME="IDX694"></A>
<A NAME="IDX695"></A>
Write the .po file using indented style.

<DT><SAMP>`--no-location&acute;</SAMP>
<DD>
<A NAME="IDX696"></A>
Do not write <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines.

<DT><SAMP>`--add-location&acute;</SAMP>
<DD>
<A NAME="IDX697"></A>
Generate <SAMP>`#: <VAR>filename</VAR>:<VAR>line</VAR>&acute;</SAMP> lines (default).

<DT><SAMP>`--strict&acute;</SAMP>
<DD>
<A NAME="IDX698"></A>
Write out a strict Uniforum conforming PO file.  Note that this
Uniforum format should be avoided because it doesn't support the
GNU extensions.

<DT><SAMP>`-w <VAR>number</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--width=<VAR>number</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX699"></A>
<A NAME="IDX700"></A>
Set the output page width.  Long strings in the output files will be
split across multiple lines in order to ensure that each line's width
(= number of screen columns) is less or equal to the given <VAR>number</VAR>.

<DT><SAMP>`--no-wrap&acute;</SAMP>
<DD>
<A NAME="IDX701"></A>
Do not break long message lines.  Message lines whose width exceeds the
output page width will not be split into several lines.  Only file reference
lines which are wider than the output page width will be split.

<DT><SAMP>`-s&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-output&acute;</SAMP>
<DD>
<A NAME="IDX702"></A>
<A NAME="IDX703"></A>
Generate sorted output.  Note that using this option makes it much harder
for the translator to understand each message's context.

<DT><SAMP>`-F&acute;</SAMP>
<DD>
<DT><SAMP>`--sort-by-file&acute;</SAMP>
<DD>
<A NAME="IDX704"></A>
<A NAME="IDX705"></A>
Sort output by file location.

</DL>



<H3><A NAME="SEC114" HREF="gettext_toc.html#TOC114">7.9.4  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX706"></A>
<A NAME="IDX707"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX708"></A>
<A NAME="IDX709"></A>
Output version information and exit.

</DL>



<H2><A NAME="SEC115" HREF="gettext_toc.html#TOC115">7.10  Invoking the <CODE>msgexec</CODE> Program</A></H2>

<P>
<A NAME="IDX710"></A>
<A NAME="IDX711"></A>

<PRE>
msgexec [<VAR>option</VAR>] <VAR>command</VAR> [<VAR>command-option</VAR>]
</PRE>

<P>
<A NAME="IDX712"></A>
The <CODE>msgexec</CODE> program applies a command to all translations of a
translation catalog.
The <VAR>command</VAR> can be any program that reads a translation from standard
input.  It is invoked once for each translation.  Its output becomes
msgexec's output.  <CODE>msgexec</CODE>'s return code is the maximum return code
across all invocations.

</P>
<P>
<A NAME="IDX713"></A>
A special builtin command called <SAMP>`0&acute;</SAMP> outputs the translation, followed
by a null byte.  The output of <SAMP>`msgexec 0&acute;</SAMP> is suitable as input for
<SAMP>`xargs -0&acute;</SAMP>.

</P>
<P>
<A NAME="IDX714"></A>
<A NAME="IDX715"></A>
During each <VAR>command</VAR> invocation, the environment variable
<CODE>MSGEXEC_MSGID</CODE> is bound to the message's msgid, and the environment
variable <CODE>MSGEXEC_LOCATION</CODE> is bound to the location in the PO file
of the message.

</P>
<P>
<A NAME="IDX716"></A>
Note: It is your responsibility to ensure that the <VAR>command</VAR> can cope
with input encoded in the translation catalog's encoding.  If the
<VAR>command</VAR> wants input in a particular encoding, you can in a first step
convert the translation catalog to that encoding using the <SAMP>`msgconv&acute;</SAMP>
program, before invoking <SAMP>`msgexec&acute;</SAMP>.  If the <VAR>command</VAR> wants input
in the locale's encoding, but you want to avoid the locale's encoding, then
you can first convert the translation catalog to UTF-8 using the
<SAMP>`msgconv&acute;</SAMP> program and then make <SAMP>`msgexec&acute;</SAMP> work in an UTF-8
locale, by using the <CODE>LC_ALL</CODE> environment variable.

</P>


<H3><A NAME="SEC116" HREF="gettext_toc.html#TOC116">7.10.1  Input file location</A></H3>

<DL COMPACT>

<DT><SAMP>`-i <VAR>inputfile</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--input=<VAR>inputfile</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX717"></A>
<A NAME="IDX718"></A>
Input PO file.

<DT><SAMP>`-D <VAR>directory</VAR>&acute;</SAMP>
<DD>
<DT><SAMP>`--directory=<VAR>directory</VAR>&acute;</SAMP>
<DD>
<A NAME="IDX719"></A>
<A NAME="IDX720"></A>
Add <VAR>directory</VAR> to the list of directories.  Source files are
searched relative to this list of directories.  The resulting <TT>`.po&acute;</TT>
file will be written relative to the current directory, though.

</DL>

<P>
If no <VAR>inputfile</VAR> is given or if it is <SAMP>`-&acute;</SAMP>, standard input is read.

</P>


<H3><A NAME="SEC117" HREF="gettext_toc.html#TOC117">7.10.2  Informative output</A></H3>

<DL COMPACT>

<DT><SAMP>`-h&acute;</SAMP>
<DD>
<DT><SAMP>`--help&acute;</SAMP>
<DD>
<A NAME="IDX721"></A>
<A NAME="IDX722"></A>
Display this help and exit.

<DT><SAMP>`-V&acute;</SAMP>
<DD>
<DT><SAMP>`--version&acute;</SAMP>
<DD>
<A NAME="IDX723"></A>
<A NAME="IDX724"></A>
Output version information and exit.

</DL>

<P><HR><P>
Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_6.html">previous</A>, <A HREF="gettext_8.html">next</A>, <A HREF="gettext_22.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
</BODY>
</HTML>