Formats / Gettext PO

PO files, with the plural header written for you

Gettext is the oldest format here and the one with the most ways to lose information. Two of them matter.

.po / .pot

The plural header is per language, and it is not optional

A PO file carries its own plural rule in the header: how many forms the language has, and an expression that maps a number onto one of them. Get it wrong and the runtime picks the wrong string for the right number, which nobody notices until somebody has two of something.

Czech is the example everyone gets wrong. Older catalogues declare three forms; CLDR says four, because a decimal quantity takes a form of its own. Linguiqo writes nplurals=4; plural=(n >= 2 && n <= 4 ? 1 : n == 1 ? 0 : 3); and lays the four boxes out in the editor accordingly.

Japanese gets one form, Arabic gets six. The header is generated from the language, never copied from the file that came in.

msgctxt is the difference between two strings that read the same

"Open" the verb and "Open" the status are one entry in a format with no context, and a translator has to guess which is on screen. Gettext solves this with msgctxt, and Linguiqo keeps it as part of the key rather than folding it away.

So the two survive a round trip as two strings, and the translator sees which is which.

What comes back out

A catalogue with the same entries in the same order, the header rewritten for the target language, and msgstr[0] through msgstr[n] filled in the order that language's rule expects.

Fuzzy entries keep their flag. A machine draft that arrived fuzzy leaves fuzzy, because the state means a human has not looked at it yet and an import is not a human looking at it.

Questions

Can I import a .pot template?

Yes. A POT is a PO with empty translations, so it imports as the source strings and nothing else.

Will it keep my comments?

Extracted comments and source references come in with the string and are shown to the translator as context.

What happens to fuzzy entries?

They arrive marked fuzzy and stay that way until somebody confirms them. Nothing is promoted to translated by an import.

Upload a Gettext PO file and see

The demo reads a real file of yours and shows what came back. No account, nothing kept.

Open the demo

What Linguiqo is