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 | Tillat tomt mål i utdata når ingen oversettelse er tilgjengelig |
bilingualMode | boolean | true | I tospråklig modus (standard) er msgid kildeteksten og msgstr er målet. I enspråklig modus behandles msgid som en ID. |
codeFinderRules | array | Regex-mønstre som matcher innebygde koder i oversettbar tekst | |
preserveUntranslated | boolean | true | Hvis sann, sendes oppføringer med tom msgstr ut som blokker. Hvis usann, hoppes de over. |
useCodeFinder | boolean | false | Aktiver regex-basert gjenkjenning av innebygd kode i PO-meldingstekst |
wrapContent | boolean | true | Bryt lange innholdslinjer i utdata ved omtrent 80 tegn |
Configure it live
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