[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Sometimes it is necessary to manipulate PO files in a way that is better
performed automatically than by hand. GNU gettext
includes a
complete set of tools for this purpose.
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 `msgcat'. It is then the translators' duty to deal with any possible conflicts that arose during the merge.
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 `msgconv' program.
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 `msggrep', another is to create a POT file for that source file and use `msgmerge'.
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 `msgfilter'.
Another use of msgfilter
is to produce approximately the POT file for
which a given PO file was made. This can be done through a filter command
like `msgfilter sed -e d | sed -e '/^# /d''. 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.
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 `msgexec' program.
When third party tools create PO or POT files, sometimes duplicates cannot
be avoided. But the GNU gettext
tools give an error when they
encounter duplicate msgids in the same file and in the same domain.
To merge duplicates, the `msguniq' program can be used.
`msgcomm' is a more general tool for keeping or throwing away duplicates, occurring in different files.
`msgcmp' can be used to check whether a translation catalog is completely translated.
`msgattrib' can be used to select and extract only the fuzzy or untranslated messages of a translation catalog.
`msgen' is useful as a first step for preparing English translation catalogs. It copies each message's msgid to its msgstr.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgcat
Program msgcat [option] [inputfile]... |
The msgcat
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 --more-than
option, greater commonality may be requested
before messages are printed. Conversely, the --less-than
option may be
used to specify less commonality before messages are printed (i.e.
`--less-than=2' will only print the unique messages). Translations,
comments and extract comments will be cumulated, except that if
--use-first
is specified, they will be taken from the first PO file
to define them. File positions from all PO files will be cumulated.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If inputfile is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgconv
Program msgconv [option] [inputfile] |
The msgconv
program converts a translation catalog to a different
character encoding.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If no inputfile is given or if it is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The default encoding is the current locale's encoding.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msggrep
Program msggrep [option] [inputfile] |
The msggrep
program extracts all messages of a translation catalog
that match a given pattern or belong to some given source files.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If no inputfile is given or if it is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[-N sourcefile]... [-M domainname]... [-K msgid-pattern] [-T msgstr-pattern] [-C comment-pattern] |
A message is selected if
When more than one selection criterion is specified, the set of selected messages is the union of the selected messages of each criterion.
msgid-pattern or msgstr-pattern syntax:
[-E | -F] [-e pattern | -f file]... |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgfilter
Program msgfilter [option] filter [filter-option] |
The msgfilter
program applies a filter to all translations of a
translation catalog.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If no inputfile is given or if it is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The filter can be any program that reads a translation from standard input and writes a modified translation to standard output. A frequently used filter is `sed'.
Note: It is your responsibility to ensure that the filter can cope
with input encoded in the translation catalog's encoding. If the
filter wants input in a particular encoding, you can in a first step
convert the translation catalog to that encoding using the `msgconv'
program, before invoking `msgfilter'. If the filter 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
`msgconv' program and then make `msgfilter' work in an UTF-8
locale, by using the LC_ALL
environment variable.
Note: Most translations in a translation catalog don't end with a newline
character. For this reason, it is important that the filter
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 `sed'
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 sed
instead; it
does not have this limitation.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msguniq
Program msguniq [option] [inputfile] |
The msguniq
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 msgfmt
,
msgmerge
or msgcat
. By default, duplicates are merged
together. When using the `--repeated' option, only duplicates are
output, and all other messages are discarded. Comments and extracted
comments will be cumulated, except that if `--use-first' is
specified, they will be taken from the first translation. File positions
will be cumulated. When using the `--unique' option, duplicates are
discarded.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If no inputfile is given or if it is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgcomm
Program msgcomm [option] [inputfile]... |
The msgcomm
program finds messages which are common to two or more
of the specified PO files.
By using the --more-than
option, greater commonality may be requested
before messages are printed. Conversely, the --less-than
option may be
used to specify less commonality before messages are printed (i.e.
`--less-than=2' 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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If inputfile is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgcmp
Program msgcmp [option] def.po ref.pot |
The msgcmp
program compares two Uniforum style .po files to check that
both contain the same set of msgid strings. The def.po file is an
existing PO file with the translations. The ref.pot file is the last
created PO file, or a PO Template file (generally created by xgettext
).
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgattrib
Program msgattrib [option] [inputfile] |
The msgattrib
program filters the messages of a translation catalog
according to their attributes, and manipulates the attributes.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If no inputfile is given or if it is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Attributes are modified after the message selection/removal has been performed.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgen
Program msgen [option] inputfile |
The msgen
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.
Note: `msginit --no-translator --locale=en' performs a very similar
task. The main difference is that msginit
cares specially about
the header entry, whereas msgen
doesn't.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If inputfile is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The results are written to standard output if no output file is specified or if it is `-'.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
msgexec
Program msgexec [option] command [command-option] |
The msgexec
program applies a command to all translations of a
translation catalog.
The command can be any program that reads a translation from standard
input. It is invoked once for each translation. Its output becomes
msgexec's output. msgexec
's return code is the maximum return code
across all invocations.
A special builtin command called `0' outputs the translation, followed by a null byte. The output of `msgexec 0' is suitable as input for `xargs -0'.
During each command invocation, the environment variable
MSGEXEC_MSGID
is bound to the message's msgid, and the environment
variable MSGEXEC_LOCATION
is bound to the location in the PO file
of the message.
Note: It is your responsibility to ensure that the command can cope
with input encoded in the translation catalog's encoding. If the
command wants input in a particular encoding, you can in a first step
convert the translation catalog to that encoding using the `msgconv'
program, before invoking `msgexec'. If the command 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
`msgconv' program and then make `msgexec' work in an UTF-8
locale, by using the LC_ALL
environment variable.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If no inputfile is given or if it is `-', standard input is read.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |