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
allowEmptyOutputTargetbooleanfalseTillat tomt mål i utdata når ingen oversettelse er tilgjengelig
bilingualModebooleantrueI tospråklig modus (standard) er msgid kildeteksten og msgstr er målet. I enspråklig modus behandles msgid som en ID.
codeFinderRulesarrayRegex-mønstre som matcher innebygde koder i oversettbar tekst
preserveUntranslatedbooleantrueHvis sann, sendes oppføringer med tom msgstr ut som blokker. Hvis usann, hoppes de over.
useCodeFinderbooleanfalseAktiver regex-basert gjenkjenning av innebygd kode i PO-meldingstekst
wrapContentbooleantrueBryt lange innholdslinjer i utdata ved omtrent 80 tegn

Configure it live

Configuration
Loading form…

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