PO (Gettext) format (.po, .pot)
PO (Portable Object) is the GNU gettext catalogue format. A .po file
pairs msgid source strings with msgstr translations, optionally
disambiguated by msgctxt, with plural forms via msgid_plural and
msgstr[N], translator and extracted comments, source references, and
#, fuzzy flags. .pot templates carry the same structure with empty
translations.
The reader emits one translatable block per message: in the default
bilingual mode the msgid is the source text and the msgstr is the
target. In monolingual mode the msgid is treated purely as an
identifier and the msgstr provides the source text instead — the
shape used by catalogues that ship message IDs rather than English
strings. Comments, context, and references are preserved on the block
and written back. This mirrors Okapi's PO filter.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
allowEmptyOutputTarget | boolean | false | Allow empty target in output when no translation is available |
bilingualMode | boolean | true | In bilingual mode (default), msgid is the source text and msgstr is the target. In monolingual mode, msgid is treated as an ID. |
codeFinderRules | array | Regex patterns that match inline codes within translatable text | |
preserveUntranslated | boolean | true | If true, entries with empty msgstr are emitted as blocks. If false, they are skipped. |
useCodeFinder | boolean | false | Enable regex-based inline code detection within PO message text |
wrapContent | boolean | true | Wrap long content lines in output at approximately 80 characters |
Configure these parameters interactively and copy the YAML on the Format Reference.
Examples
Monolingual catalogue
Treat msgid as an identifier and msgstr as the source text.
bilingualMode: false
Skip untranslated entries
Extract only messages that already carry a translation.
preserveUntranslated: false
Processing notes
One block is emitted per message;
msgctxtis stored on the block context, and comments and references are preserved.Plural forms (
msgid_plural/msgstr[N]) and#, fuzzyflags are recognised and round-tripped.
← Back to the Format Reference