Gå til hovedinnhold

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.

IDpo
SourceBuilt-in
Extensions.po, .pot
MIME Typestext/x-gettext-translation
CapabilitiesRead + Write

Parameters

ParameterTypeDefaultDescription
allowEmptyOutputTargetbooleanfalseAllow empty target in output when no translation is available
bilingualModebooleantrueIn bilingual mode (default), msgid is the source text and msgstr is the target. In monolingual mode, msgid is treated as an ID.
codeFinderRulesarrayRegex patterns that match inline codes within translatable text
preserveUntranslatedbooleantrueIf true, entries with empty msgstr are emitted as blocks. If false, they are skipped.
useCodeFinderbooleanfalseEnable regex-based inline code detection within PO message text
wrapContentbooleantrueWrap 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; msgctxt is stored on the block context, and comments and references are preserved.

  • Plural forms (msgid_plural / msgstr[N]) and #, fuzzy flags are recognised and round-tripped.

← Back to the Format Reference