View on GitHub

popp

a PO file preprocessor for Gnu .po language translation/localization files.

Download this project as a .zip file Download this project as a tar.gz file Download Windows .exe file

Features

The preprocessor allows your translated text to reference other items of translated text, in a way that should work within any .PO editor. The use of $include statements is also supported, and conditional directives might be added in future.

See the GNU gettext documentation for information about PO files.

For example, you can have .PO source files like this:

msgid "ProductName short"
msgstr "POpp"

msgid "Welcome text"
msgstr "Congratulations on your download of {id:productname short}"

and it can be converted automatically to this:

msgid "ProductName short"
msgstr "POpp"

msgid "Welcome text"
msgstr "Congratulations on your download of POpp"

Current version:

Documentation:

.PO msgstrs can reference other msgstr values using a curly brace notation, for example {id:ProductName_short} will be expanded to the msgstr which has the msgid of ProductName_short.

Usage:

popp [options] source.popp [dest.po]

Brace notation:

WARNING: Plural forms are not supported, the file can still be processed, however lines begining with "msgstr[n]" will not have their content expanded, and plural forms cannot be referenced with the brace notation.

$include notation

The following include statements are all valid notation

$include "file.po"

# $include "file.po"
#.$include "file.po"

The .po hash-comment notations can be used if the file must be editable or parsable by other .po tools before being processed by popp.

Output, and pipes

Output files are written in UTF-8. If your source languages use unicode characters that your shell can't display, then avoid using pipes and stick with specifying an input file and an output file. Or proceed very carefully, as you risk having the unicode characters mapped to what the shell can handle.

Options:

Returns: